<?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)();
Warning: Undefined property: bla::$bar in /in/UjMHD on line 18
Fatal error: Uncaught Error: Value of type null is not callable in /in/UjMHD:18
Stack trace:
#0 {main}
thrown in /in/UjMHD on line 18
Process exited with code 255.
Notice: Undefined property: bla::$bar in /in/UjMHD on line 18
Fatal error: Uncaught Error: Function name must be a string in /in/UjMHD:18
Stack trace:
#0 {main}
thrown in /in/UjMHD on line 18
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Function name must be a string in /in/UjMHD:18
Stack trace:
#0 {main}
thrown in /in/UjMHD on line 18
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Parse error: syntax error, unexpected '(' in /in/UjMHD on line 18
Process exited with code 255.