3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test{ $i = array(); function plus($t) { $this->i[]=$t; } } $test = array(); for($i =0 ;$i<10000;++$i) { $t = new test; $t->plus($i); $test[] = $t; }
Output for 5.4.0 - 5.4.24, 5.5.0 - 5.5.8
Parse error: syntax error, unexpected '$i' (T_VARIABLE), expecting function (T_FUNCTION) in /in/D3FHV on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/D3FHV on line 3
Process exited with code 255.

preferences:
189.33 ms | 1395 KiB | 70 Q