3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ public function __construct() { $this->a = 'a'; } public function a() { echo 'a'; } public a; } echo A::a;
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected 'a' (T_STRING), expecting variable (T_VARIABLE) in /in/1Ug84 on line 12
Process exited with code 255.
Output for 5.3.3 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/1Ug84 on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.2
Strict Standards: Redefining already defined constructor for class A in /in/1Ug84 on line 7 Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/1Ug84 on line 12
Process exited with code 255.

preferences:
173.19 ms | 1395 KiB | 53 Q