amitmerchant1990 / amitmerchant-dot-com-comments

1 stars 0 forks source link

method-overloading-in-php/ #11

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Method overloading in PHP – Amit Merchant – A blog on PHP, JavaScript and more

Although the official PHP website’s documentation has a dedicated section on “Overloading”, it’s not truly called overloading by any means.

https://www.amitmerchant.com/method-overloading-in-php/

yaddly commented 3 years ago

Hi, thank you for this trick, however if I try to run it as is, it does not return a value until I modify it as follows:

return call_user_func_array(array($this, $function), $arguments);

This returns the value handed over by a specific overloaded method.