3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Kitchen { private $yummy = 'cake'; } $kitchen = new Kitchen(); $sweetsThief = Closure::bind($sweetsThief, null, $kitchen); var_dump($sweetsThief($kitchen));
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: sweetsThief in /in/Yrnmv on line 12 Warning: Closure::bind() expects parameter 1 to be Closure, null given in /in/Yrnmv on line 12 Fatal error: Uncaught Error: Function name must be a string in /in/Yrnmv:14 Stack trace: #0 {main} thrown in /in/Yrnmv on line 14
Process exited with code 255.
Output for hhvm-3.12.0
Notice: Undefined variable: sweetsThief in /in/Yrnmv on line 12 Catchable fatal error: Argument 1 passed to Closure::bind() must be an instance of Closure, null given in /in/Yrnmv on line 12
Process exited with code 255.
Output for hhvm-3.10.0
Notice: Undefined variable: sweetsThief in /in/Yrnmv on line 12 Warning: Closure::bind() expects parameter 1 to be an object in /in/Yrnmv on line 12 Fatal error: Function name must be a string in /in/Yrnmv on line 14
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Notice: Undefined variable: sweetsThief in /in/Yrnmv on line 12 Warning: Closure::bind() expects parameter 1 to be Closure, null given in /in/Yrnmv on line 12 Fatal error: Function name must be a string in /in/Yrnmv on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Fatal error: Call to undefined method Closure::bind() in /in/Yrnmv on line 12
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Fatal error: Class 'Closure' not found in /in/Yrnmv on line 12
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/Yrnmv on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/Yrnmv on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/Yrnmv on line 5
Process exited with code 255.