3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $i = 0; $x = []; class person { public $firstname; public $lastname; } $start = microtime( true ); do { $p = new person; $p->firstname = "Patrick"; $p->lastname = "Allaert"; $x[] = $p; ++$i; } while ( $i < 500000 ); echo microtime( true ) - $start, "\n", memory_get_peak_usage(), "\n";
Output for 7.1.0
0.078185081481934 61315976
Output for 7.0.14
0.090728998184204 61315992
Output for 7.0.7
0.076229095458984 61315992
Output for 7.0.6
0.07704496383667 61315992
Output for 7.0.5
0.091581106185913 61315992
Output for 7.0.4
0.081156015396118 61315992
Output for 7.0.3
0.085567951202393 61315992
Output for 7.0.2
0.057257175445557 61315992
Output for 7.0.1
0.078820943832397 61315992
Output for 7.0.0
0.082988023757935 61315992
Output for hhvm-3.12.0
0.12767481803894 33554432
Output for hhvm-3.10.0
0.15390682220459 33554432
Output for 5.4.0 - 5.4.9, 5.5.0 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/sX13Z on line 10
Process exited with code 255.
Output for 5.4.10 - 5.4.45
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/sX13Z on line 12
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/sX13Z on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/sX13Z on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/sX13Z on line 3
Process exited with code 255.