3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* How many times the code under test should run in each function */ define('LOOP',1000000); function f1() { $path = NULL; for($i=0; $i<LOOP; ++$i) { $md5 = md5(str_shuffle('asbfdgdg5y54yy5rh45g5ge5g5g')); $yy = date('y'); $ab = substr($md5, 0, 2); $cd = substr($md5, 2, 2); $path = 'some' . '/'; $path .= $yy . '/'; $path .= $ab . '/'; $path .= $cd . '/'; } } function f2() { $path = NULL; for($i=0; $i<LOOP; ++$i) { $md5 = md5(str_shuffle('asbfdgdg5y54yy5rh45g5ge5g5g')); $yy = date('y'); $ab = substr($md5, 0, 2); $cd = substr($md5, 2, 2); $path = sprintf('%s/%s/%s/%s', 'some', $yy, $ab, $cd); } } $start = microtime(true); f1(); $stop = microtime(true); $time1 = $stop - $start; $start = microtime(true); f2(); $stop = microtime(true); $time2 = $stop - $start; echo $time1 . "\t"; echo $time2 . "\n";

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.00.0002.50119.67
7.1.70.0002.50117.02
7.1.60.0072.49519.46
7.1.50.0102.49117.21
7.1.00.0072.49322.33
7.0.200.0032.49817.00
7.0.140.0072.49322.09
7.0.100.0032.49719.98
7.0.90.0132.48719.88
7.0.80.0072.49320.04
7.0.70.0202.48019.91
7.0.60.0072.49319.80
7.0.50.0032.49720.40
7.0.40.0132.48720.11
7.0.30.0072.47720.00
7.0.20.2632.20720.19
7.0.10.0072.45320.07
7.0.00.0102.46320.10
5.6.280.0032.49721.04
5.6.250.0072.49320.73
5.6.240.0202.48020.70
5.6.230.0072.49320.63
5.6.220.0102.49020.66
5.6.210.0132.48720.49
5.6.200.0032.49721.12
5.6.190.0102.49021.03
5.6.180.0032.48321.04
5.6.170.0002.44321.05
5.6.160.0072.45321.04
5.6.150.0102.49020.99
5.6.140.0072.49320.96
5.6.130.0102.49020.94
5.6.120.0032.49721.02
5.6.110.0032.49721.00
5.6.100.0032.49721.02
5.6.90.0002.48720.98
5.6.80.0072.47320.38
5.6.70.0032.49720.52
5.6.60.0202.48020.31
5.6.50.0132.48720.48
5.6.40.0202.48020.32
5.6.30.0072.49320.38
5.6.20.0002.46320.39
5.6.10.0002.48020.38
5.6.00.0002.50020.52
5.5.380.0132.48720.40
5.5.370.0032.49720.41
5.5.360.0032.49720.35
5.5.350.0072.49320.43
5.5.340.0032.49720.89
5.5.330.0072.49320.77
5.5.320.3402.12720.78
5.5.310.0132.45020.74
5.5.300.0132.47020.82
5.5.290.0032.49720.84
5.5.280.0072.47720.84
5.5.270.0072.46320.80
5.5.260.0102.47320.79
5.5.250.0032.44020.64
5.5.240.0032.49720.30
5.5.230.0032.49720.31
5.5.220.0102.49020.11
5.5.210.0102.49020.19
5.5.200.0172.48320.26
5.5.190.0002.48720.24
5.5.180.0072.47720.12
5.5.160.0072.49320.25
5.5.150.0072.46020.21
5.5.140.0002.50020.13
5.5.130.0072.49320.21
5.5.120.0072.49320.20
5.5.110.0072.47020.26
5.5.100.0172.48320.17
5.5.90.0072.49320.17
5.5.80.0072.49320.16
5.5.70.0032.49720.17
5.5.60.0072.49320.07
5.5.50.0102.48020.10
5.5.40.0002.50020.06
5.5.30.0102.49020.11
5.5.20.0102.47020.05
5.5.10.0102.49020.10
5.5.00.0102.46020.05
5.4.450.0032.43019.38
5.4.440.0072.49319.26
5.4.430.0102.49019.21
5.4.420.0032.49719.45
5.4.410.0032.47719.25
5.4.400.0102.49018.98
5.4.390.0072.49319.15
5.4.380.0172.48319.00
5.4.370.0032.49719.16
5.4.360.0032.49718.84
5.4.350.0032.49718.99
5.4.340.0032.49719.15
5.4.320.0032.49719.12
5.4.310.0032.49718.95
5.4.300.0072.49319.12
5.4.290.0072.49318.96
5.4.280.0072.49318.98
5.4.270.0072.49318.83
5.4.260.0032.49718.99
5.4.250.0002.50018.97
5.4.240.0032.49719.12
5.4.230.0132.48718.79
5.4.220.0032.49719.11
5.4.210.0072.49319.11
5.4.200.0072.46018.97
5.4.190.0132.45318.96
5.4.180.0002.50019.14
5.4.170.0002.50018.78
5.4.160.0072.49318.80
5.4.150.0032.49719.13
5.4.140.0132.44016.45
5.4.130.0072.49316.48
5.4.120.0102.49016.39
5.4.110.0072.49316.28
5.4.100.0002.50016.34
5.4.90.0032.49716.46
5.4.80.0102.49016.30
5.4.70.0032.49716.47
5.4.60.0072.49316.43
5.4.50.0032.46716.36
5.4.40.0032.49716.25
5.4.30.0002.50016.30
5.4.20.0102.49016.41
5.4.10.0102.49016.45
5.4.00.0032.49715.67

preferences:
33.47 ms | 400 KiB | 5 Q