- Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17, 7.0.0 - 7.0.2
- Parse error: syntax error, unexpected '$arr' (T_VARIABLE), expecting function (T_FUNCTION) in /in/8mZnd on line 4
Process exited with code 255.
<?php
class Foo {
$arr = array("test");
function bar($str) {
if ( is_callable( self::$arr[0] ) ){
echo self::$arr[0]($str);
}
}
static function test($var) {
echo "Testing: $var\n";
}
}
(new Foo)->bar("bla");