3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php <?php $starttime = microtime(true); $sArr = array(); for ($i = 0; $i < 300000; $i++) { $sArr[] = 'String concatenation. ' . $i; } $str = implode('', $sArr); $x = md5($str); $endtime = microtime(true); print "array append & implode: " . ($endtime - $starttime) . " s\n" ; // standard string append $starttime = microtime(true); $str = ''; for ($i = 0; $i < 300000; $i++) { $str .= 'String concatenation. ' . $i; } $x = md5($str); unset($str); $endtime = microtime(true); print "string concat: " . ($endtime - $starttime) . " s\n" ; $starttime = microtime(true); $sArr = array(); for ($i = 0; $i < 300000; $i++) { $sArr[] = 'String concatenation. ' . $i; } $str = implode('', $sArr); $x = md5($str); $endtime = microtime(true); print "array append & implode: " . ($endtime - $starttime) . " s\n" ;
Output for 5.3.25 - 5.3.26, 5.4.16
Parse error: syntax error, unexpected '<' in /in/UHosf on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.24, 5.4.0 - 5.4.15
Parse error: syntax error, unexpected '<' in UHosf on line 2
Process exited with code 255.