Why can't I do that?
function ($var1, $var2 = $GLOBALS['var']){
...
}
the global 'var' is a object
You can't use variables as default values. You can use this:
function ($var1, $var2 = null){
if(is_null($var2))
$var2=$GLOBALS['var'];
...
}
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