3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { private $db = 'my database name'; } $dbName = function(Test $test) { return $test->db; } $test = new Test(); var_dump($dbName($test));
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected '$test' (T_VARIABLE) in /in/uYY53 on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/uYY53 on line 10
Process exited with code 255.