3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php (function ($a, $b) { var_dump($a, $b); })->bindto($this, null)("a", "b");
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/fvh3X:5 Stack trace: #0 {main} thrown in /in/fvh3X on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: this in /in/fvh3X on line 5 string(1) "a" string(1) "b"
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/fvh3X on line 5
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/fvh3X on line 5
Process exited with code 255.