3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Kitchen { private $yummy = 'cake'; } $sweetsThief = function (Kitchen $kitchen) { return $kitchen->yummy; } $kitchen = new Kitchen(); var_dump($sweetsThief($kitchen));
Output for 5.4.0 - 7.1.0
Parse error: syntax error, unexpected '$kitchen' (T_VARIABLE) in /in/gXfEJ on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_VARIABLE in /in/gXfEJ on line 12
Process exited with code 255.