3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test{ var a = '1'; public function getA() { return $this->a; } } $a = new test(); echo test->getA();
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected 'a' (T_STRING), expecting variable (T_VARIABLE) in /in/Ma5Ka on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/Ma5Ka on line 3
Process exited with code 255.

preferences:
191.99 ms | 1399 KiB | 56 Q