3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string1 = 'aaaaaaaaaaaaaaaaaaaa'; $string2 = 'bbbbbbbbbbbbbbbbbbbb'; $string3 = 'cccccccccccccccccccc'; $string4 = 'dddddddddddddddddddd'; $string5 = 'eeeeeeeeeeeeeeeeeeee'; $time1 = microtime(); for ($k = 0; $k<100.00; $k++) { $concatTest1 = $string1 . $string2 . $string3 . $string4 . $string5; } $time2 = microtime(); $testDuration1 = $time2 - $time1; $time3 = microtime(); for ($m = 0; $m<100.00; $m++) { $concatTest2 = "{$string1}{$string2}{$string3}{$string4}{$string5}"; } $time4 = microtime(); $testDuration2 = $time4 - $time3; $time5 = microtime(); for ($p = 0; $p<100.00; $p++) { $concatTest3 = implode('', array($string1, $string2, $string3, $string4, $string5)); } $time6 = microtime(); $testDuration3 = $time6 - $time5; print_r( $testDuration1, $testDuration2, $testDuration3 );
Output for 7.1.5 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
Notice: A non well formed numeric value encountered in /in/cckYY on line 16 Notice: A non well formed numeric value encountered in /in/cckYY on line 16 Notice: A non well formed numeric value encountered in /in/cckYY on line 24 Notice: A non well formed numeric value encountered in /in/cckYY on line 24 Notice: A non well formed numeric value encountered in /in/cckYY on line 33 Notice: A non well formed numeric value encountered in /in/cckYY on line 33 Warning: print_r() expects at most 2 parameters, 3 given in /in/cckYY on line 39
Output for 7.1.0
Notice: A non well formed numeric value encountered in /in/cckYY on line 16 Notice: A non well formed numeric value encountered in /in/cckYY on line 16 Notice: A non well formed numeric value encountered in /in/cckYY on line 24 Notice: A non well formed numeric value encountered in /in/cckYY on line 24 Notice: A non well formed numeric value encountered in /in/cckYY on line 33 Notice: A non well formed numeric value encountered in /in/cckYY on line 33 Warning: print_r() expects at most 2 parameters, 3 given in /in/cckYY on line 36
Output for 7.0.20
Warning: print_r() expects at most 2 parameters, 3 given in /in/cckYY on line 39
Output for 7.0.0 - 7.0.14
Warning: print_r() expects at most 2 parameters, 3 given in /in/cckYY on line 36
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.35, 5.6.0 - 5.6.21
Warning: print_r() expects at most 2 parameters, 3 given in /in/cckYY on line 40

preferences:
163.05 ms | 403 KiB | 236 Q