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() { for($i=0; $i<LOOP; ++$i) { str_replace('_', '-', 'parse-url-without-regular-expression'); } } function f2() { for($i=0; $i<LOOP; ++$i) { preg_replace('/_/', '-', 'parse-url-without-regular-expression'); } } $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.4.00.0100.25115.09
7.3.120.0000.19015.02
7.3.110.0070.18615.03
7.3.100.0070.23814.86
7.3.90.0070.17515.14
7.3.80.0030.20114.73
7.3.70.0070.15415.16
7.3.60.0030.18014.81
7.3.50.0000.15415.09
7.3.40.0070.17614.99
7.3.30.0030.19914.96
7.3.20.0000.22716.96
7.3.10.0100.16716.85
7.3.00.0070.15316.83
7.2.250.0030.19415.24
7.2.240.0070.29615.36
7.2.230.0030.18915.03
7.2.220.0100.23414.97
7.2.210.0070.17115.36
7.2.200.0030.17315.06
7.2.190.0000.24914.96
7.2.180.0070.22915.02
7.2.170.0030.16915.41
7.2.00.0030.18919.54
7.1.330.0070.37616.18
7.1.320.0030.31315.72
7.1.310.0030.29116.08
7.1.300.0100.29215.97
7.1.290.0070.31715.98
7.1.280.0030.30715.86
7.1.270.0100.36815.65
7.1.260.0000.28016.06
7.1.70.0030.19617.39
7.1.60.0100.22619.43
7.1.50.0200.22617.17
7.0.200.0100.16515.15
7.0.50.0200.32714.52
7.0.40.0270.28014.73
7.0.30.0170.31314.63
7.0.20.0170.29314.69
7.0.10.0200.29014.63
7.0.00.0200.33314.77
5.6.200.0131.49020.64
5.6.190.0000.99720.72
5.6.180.0031.02720.61
5.6.170.0100.93320.77
5.6.160.0301.10320.61
5.6.150.0071.10320.85
5.6.140.0101.03320.71
5.5.340.0071.08718.09
5.5.330.0171.00317.96
5.5.320.0130.89017.85
5.5.310.0100.98717.89
5.5.300.0101.05717.63
5.4.450.0000.99319.06
5.4.440.0030.95719.25
5.4.430.0100.92319.05
5.4.420.0100.94719.25
5.4.410.0130.96319.25
5.4.400.0071.17718.91
5.4.390.0030.97318.80
5.4.380.0170.88718.98
5.4.370.0131.06318.89
5.4.360.0171.06719.06
5.4.350.0170.93318.95
5.4.340.0170.99318.99
5.4.320.0200.92718.97
5.4.310.0130.84319.00
5.4.300.0100.85318.93
5.4.290.0100.85318.96
5.4.280.0070.92318.80
5.4.270.0100.96718.99
5.4.260.0100.86318.77
5.4.250.0101.02718.89
5.4.240.0070.93318.72
5.4.230.0130.96318.87
5.4.220.0070.93318.96
5.4.210.0170.94718.77
5.4.200.0070.99018.75
5.4.190.0100.92318.64
5.4.180.0130.91718.91
5.4.170.0131.05318.95
5.4.160.0101.08718.88
5.4.150.0171.00319.05
5.4.140.0171.03016.43
5.4.130.0030.92316.63
5.4.120.0100.85716.58
5.4.110.0031.20716.38
5.4.100.0001.08016.44
5.4.90.0101.19716.44
5.4.80.0101.01316.42
5.4.70.0031.03016.60
5.4.60.0101.30716.31
5.4.50.0130.91316.57
5.4.40.0170.95316.39
5.4.30.0231.09016.53
5.4.20.0031.08016.46
5.4.10.0201.01316.54
5.4.00.0100.96315.82
5.3.290.0001.08714.80
5.3.280.0071.23014.61
5.3.270.0171.17014.83
5.3.260.0101.27314.61
5.3.250.0101.64314.44
5.3.240.0131.72714.63
5.3.230.0171.09014.58
5.3.220.0071.24314.72
5.3.210.0171.27714.73
5.3.200.0131.15314.40
5.3.190.0131.22714.75
5.3.180.0071.15714.55
5.3.170.0031.42014.57
5.3.160.0101.33714.75
5.3.150.0171.19314.55
5.3.140.0071.74314.63
5.3.130.0171.54714.63
5.3.120.0171.72314.63
5.3.110.0231.47314.63
5.3.100.0131.38313.95
5.3.90.0201.49014.01
5.3.80.0201.38714.06
5.3.70.0331.51314.12
5.3.60.0201.56014.16
5.3.50.0301.79013.77
5.3.40.0071.45313.89
5.3.30.0251.46314.00
5.3.20.0271.64713.94
5.3.10.0271.52013.59
5.3.00.0301.45313.86

preferences:
34.34 ms | 400 KiB | 5 Q