3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $ln = 1000; $a = array(); $b = array(); for ($i = 0; $i < $ln; $i++) { $a[] = 10000 + $i; $b[md5($i)] = 20000 + $i; } $s = microtime(true); $r1 = array_merge($a, array_values($b)); var_dump('merge + values = ' . ($s - microtime(true)); $s = microtime(true); foreach ($b as $x) { $a[] = $x; } var_dump('foreach = ' . ($s - microtime(true)); var_dump($r1 === $a);
Output for 5.3.0 - 5.4.22
Parse error: syntax error, unexpected ';' in /in/C4Tp0 on line 12
Process exited with code 255.