<?php
function test($var){
echo "in function: ",__FUNCTION__;
echo "testing $var\n";
}
class bla {
public $foo = ["test"];
public function bar($str="default") {
echo ($this->foo)($str),"\n"; // php5 fails w/o method below specified
}
}
(new bla)->bar();
Fatal error: Uncaught Error: Array callback must have exactly two elements in /in/mOLaP:12
Stack trace:
#0 /in/mOLaP(17): bla->bar()
#1 {main}
thrown in /in/mOLaP on line 12
Process exited with code 255.
Fatal error: Uncaught Error: Function name must be a string in /in/mOLaP:12
Stack trace:
#0 /in/mOLaP(17): bla->bar()
#1 {main}
thrown in /in/mOLaP on line 12
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Parse error: syntax error, unexpected '(', expecting ',' or ';' in /in/mOLaP on line 12
Process exited with code 255.