Since a recent version of php added anonymous functions, is there a way to extend functions? in Javascript I'd do:
var temp = immaFunction;
immaFunction = function(){
//do some random stuff
temp.apply(this, arguments);
}
As of 5.3, PHP has first class anonymous functions.
A few points to consider however(will be filling this with more as I mess around with it.):
Example 1:
$foo = "bar";
$fooBar = function() use ($foo){
echo $foo;
}
$fooBar(); //bar
PHP 5.3 supports that link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With