3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected function a() { return array(1, 2 ,3); } public __get($name) { return $this->a(); } } $a = new A; echo $a->abc[0];
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected '__get' (T_STRING), expecting variable (T_VARIABLE) in /in/tmYhT on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/tmYhT on line 10
Process exited with code 255.

preferences:
185.36 ms | 940 KiB | 67 Q