3v4l.org

run code in 300+ PHP versions simultaneously
<?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 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.29, 7.0.0 - 7.0.14, 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.

preferences:
232.02 ms | 1395 KiB | 166 Q