Whilst working on a little library recently, I discovered some interesting behavior with PHP’s __call magic method. Specifically around using named arguments in methods that are caught by the __call method. Given the following class: Calling a non-existing method without named parameters would result in the arguments being given to __call as an indexed array:…
Consider this PHP class: We could call the bar method as follows: However, in PHP, we have the ability to call methods that don’t actually exist on a class. They can instead be caught by a “magic method” named __call, which you can define on your class. So if you instantiated the BazClass above and…
Bought the Horizon Forbidden West tallneck lego.