3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(version_compare(PHP_VERSION, '5.0') <= 0) { die('Skipped'); } // Setup $class = 'Concrete5_Model_User'; $count = 10000; // Warm up for($i = 0; $i < $count; $i++) { strpos($class, 'Concrete5_Model_'); } // Test - case sensitive $t0 = microtime(true); for($i = 0; $i < $count; $i++) { if(strpos($class, 'Concrete5_Model_') === 0) { } } $deltaCS = microtime(true) - $t0; // Test - case insensitive $t0 = microtime(true); for($i = 0; $i < $count; $i++) { if(stripos($class, 'Concrete5_Model_') === 0) { } } $deltaCI = microtime(true) - $t0; // Test - substr $t0 = microtime(true); for($i = 0; $i < $count; $i++) { $ss = 'Concrete5_Model_'; if(substr($class, 0, strlen($ss)) === $ss) { } } $deltaSS = microtime(true) - $t0; echo "case sensitive: ", round($deltaCS * 1000, 2), " ms\n"; echo "case insensitive: ", round($deltaCI * 1000, 2), " ms\n"; echo "case substring: ", round($deltaSS * 1000, 2), " ms\n"; echo "case sensitive gain: ", round($deltaCI * 100 / $deltaCS - 100, 2), " %\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.0000.01619.05
7.1.70.0030.00917.38
7.1.60.0000.01617.25
7.1.50.0140.01717.10
7.1.00.0100.07322.50
7.0.200.0000.02016.66
7.0.140.0000.08322.18
7.0.100.0130.08320.05
7.0.90.0030.09019.93
7.0.80.0100.07719.96
7.0.70.0130.07719.95
7.0.60.0130.07019.98
7.0.50.0000.05720.26
7.0.40.0070.05320.07
7.0.30.0130.06020.12
7.0.20.0130.04320.03
7.0.10.0130.07020.00
7.0.00.0170.04720.09
5.6.280.0130.07320.93
5.6.250.0030.08020.50
5.6.240.0030.09320.66
5.6.230.0200.07020.66
5.6.220.0130.08720.59
5.6.210.0170.08720.69
5.6.200.0030.09721.17
5.6.190.0130.08320.94
5.6.180.0070.07321.07
5.6.170.0000.08721.08
5.6.160.0070.09021.01
5.6.150.0030.09721.16
5.6.140.0100.09321.07
5.6.130.0070.05721.10
5.6.120.0230.06321.02
5.6.110.0030.05720.93
5.6.100.0030.07721.01
5.6.90.0030.06321.07
5.6.80.0100.04020.47
5.6.70.0170.06020.55
5.6.60.0100.08720.38
5.6.50.0170.08320.41
5.6.40.0030.06720.37
5.6.30.0070.09320.32
5.6.20.0070.07720.43
5.6.10.0100.08720.48
5.6.00.0170.05320.36
5.5.380.0100.09720.45
5.5.370.0200.08020.37
5.5.360.0100.10320.45
5.5.350.0100.06720.33
5.5.340.0130.09020.63
5.5.330.0070.09020.78
5.5.320.0100.08320.84
5.5.310.0100.07720.92
5.5.300.0070.08020.93
5.5.290.0070.07720.92
5.5.280.0030.07320.83
5.5.270.0100.08720.91
5.5.260.0070.09020.77
5.5.250.0100.08320.67
5.5.240.0130.08020.21
5.5.230.0100.05320.28
5.5.220.0100.10320.21
5.5.210.0070.07020.29
5.5.200.0130.08320.10
5.5.190.0200.06320.17
5.5.180.0070.06020.18
5.5.160.0070.05320.22
5.5.150.0100.06020.22
5.5.140.0070.09020.12
5.5.130.0130.05020.07
5.5.120.0100.06720.27
5.5.110.0200.08320.20
5.5.100.0130.07020.02
5.5.90.0170.08020.16
5.5.80.0070.09020.06
5.5.70.0200.07320.05
5.5.60.0070.08320.03
5.5.50.0070.06720.10
5.5.40.0130.08020.14
5.5.30.0170.07719.92
5.5.20.0170.08320.14
5.5.10.0130.08020.03
5.5.00.0130.08720.03
5.4.450.0130.09019.17
5.4.440.0070.07019.24
5.4.430.0100.08719.62
5.4.420.0070.09319.29
5.4.410.0030.07319.18
5.4.400.0070.07718.96
5.4.390.0130.07719.30
5.4.380.0070.08019.05
5.4.370.0070.06019.02
5.4.360.0000.07319.01
5.4.350.0030.06319.16
5.4.340.0100.08718.88
5.4.320.0130.06719.16
5.4.310.0100.08019.19
5.4.300.0130.05019.09
5.4.290.0000.05318.89
5.4.280.0170.07319.09
5.4.270.0100.04318.96
5.4.260.0030.09319.11
5.4.250.0100.05718.86
5.4.240.0070.08718.96
5.4.230.0030.09019.07
5.4.220.0100.08319.18
5.4.210.0170.07319.11
5.4.200.0100.07718.97
5.4.190.0100.06719.10
5.4.180.0070.09019.17
5.4.170.0030.08319.05
5.4.160.0030.08019.27
5.4.150.0100.07719.12
5.4.140.0000.05316.23
5.4.130.0130.06716.30
5.4.120.0030.08716.30
5.4.110.0130.07716.44
5.4.100.0170.07316.38
5.4.90.0100.08316.37
5.4.80.0070.08316.39
5.4.70.0030.09016.27
5.4.60.0070.08016.18
5.4.50.0070.08016.41
5.4.40.0070.08316.32
5.4.30.0070.07716.18
5.4.20.0070.08016.27
5.4.10.0070.08716.41
5.4.00.0030.08715.58
5.3.290.0130.08714.64
5.3.280.0000.09714.55
5.3.270.0070.07314.50
5.3.260.0070.09014.50
5.3.250.0100.08714.61
5.3.240.0030.06014.57
5.3.230.0070.08714.59
5.3.220.0100.08014.64
5.3.210.0100.09014.63
5.3.200.0130.08714.50
5.3.190.0030.09714.59
5.3.180.0170.08014.47
5.3.170.0070.07014.50
5.3.160.0130.07314.54
5.3.150.0100.09314.50
5.3.140.0070.09314.53
5.3.130.0170.07314.54
5.3.120.0030.09314.61
5.3.110.0070.08714.46
5.3.100.0130.06014.03
5.3.90.0070.07713.95
5.3.80.0070.08713.99
5.3.70.0070.09314.10
5.3.60.0030.06013.88
5.3.50.0030.06713.82
5.3.40.0100.04713.86
5.3.30.0070.08313.70
5.3.20.0100.07713.56
5.3.10.0030.06013.44
5.3.00.0070.07313.52
5.2.170.0030.08312.61
5.2.160.0000.07312.61
5.2.150.0000.04712.61
5.2.140.0030.04312.61
5.2.130.0000.07712.61
5.2.120.0030.04312.61
5.2.110.0030.04312.61
5.2.100.0030.04712.61
5.2.90.0030.05712.61
5.2.80.0000.08312.61
5.2.70.0100.07312.61
5.2.60.0000.05012.61
5.2.50.0130.07012.61
5.2.40.0130.07012.61
5.2.30.0030.04012.61
5.2.20.0030.04312.61
5.2.10.0070.08312.61
5.2.00.0070.06312.61
5.1.60.0000.05312.61
5.1.50.0070.06712.61
5.1.40.0030.06312.61
5.1.30.0030.07712.61
5.1.20.0100.07012.61
5.1.10.0000.08712.61
5.1.00.0070.05312.61
5.0.50.0030.07712.61
5.0.40.0070.07712.61
5.0.30.0070.08712.61
5.0.20.0070.07012.61
5.0.10.0030.08012.61
5.0.00.0130.08712.61
4.4.90.0070.02012.61
4.4.80.0030.01712.61
4.4.70.0030.03312.61
4.4.60.0070.03312.61
4.4.50.0030.03012.61
4.4.40.0030.05312.61
4.4.30.0030.03312.61
4.4.20.0030.02312.61
4.4.10.0000.02012.61
4.4.00.0070.04012.61
4.3.110.0100.02012.61
4.3.100.0030.02712.61
4.3.90.0000.03712.61
4.3.80.0000.05012.61
4.3.70.0030.03312.61
4.3.60.0030.03312.61
4.3.50.0000.03012.61
4.3.40.0030.04712.61
4.3.30.0000.03312.61
4.3.20.0030.03312.61
4.3.10.0000.03012.61
4.3.00.0000.02012.61

preferences:
33.73 ms | 401 KiB | 5 Q