3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { const ALPHA = 1, BETA = 2, GAMMA = 3; public $a = "apple", $b = "bread", $c = "candy"; public function __construct() { // do something } } $t = new Test; echo $t->ALPHA $t->c $t->$a;
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '$t' (T_VARIABLE), expecting ',' or ';' in /in/PM31F on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /in/PM31F on line 14
Process exited with code 255.

preferences:
195.03 ms | 1395 KiB | 65 Q