3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $test = null; public $anything = true; private function getTest() { return $this->test; } } $fn = function () { echo $this->test; echo $this->getTest(); echo $this->anything; } $a = new A(); $fn->bindTo($a, $a); $fn();
Output for 5.4.18
Parse error: syntax error, unexpected '$a' (T_VARIABLE) in /in/F2127 on line 26
Process exited with code 255.
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected '$a' (T_VARIABLE) in /in/6Khkb on line 26
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/6Khkb on line 26
Process exited with code 255.

preferences:
185.96 ms | 1395 KiB | 54 Q