3v4l.org

run code in 300+ PHP versions simultaneously
<?php $aShitLoadOfSpaces = ' '; $headerName = 'CONTENT-LENGTH'; $start = microtime(true); for ($i = 0; $i < 500000; $i++) { if (strtolower($headerName) === 'content-length') {} } $duration = microtime(true) - $start; echo "strtolower: $duration\n"; $start = microtime(true); for ($i = 0; $i < 500000; $i++) { if ((($aShitLoadOfSpaces & $headerName) | $headerName) === 'content-length') {} } $duration = microtime(true) - $start; echo "Bitwise 1: $duration\n"; $start = microtime(true); for ($i = 0; $i < 500000; $i++) { if (trim($aShitLoadOfSpaces | $headerName) === 'content-length') {} } $duration = microtime(true) - $start; echo "Bitwise 2: $duration\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.0030.14718.94
7.1.70.0070.15117.22
7.1.60.0100.22119.25
7.1.50.0100.22116.99
7.1.00.0070.15722.51
7.0.200.0030.15116.61
7.0.140.0030.24721.96
7.0.120.0030.24722.16
7.0.60.0070.25719.84
7.0.50.0000.26317.86
7.0.40.0070.25320.20
7.0.30.0270.26020.30
7.0.20.0400.21720.19
7.0.10.0230.23020.13
7.0.00.0130.22020.08
5.6.280.0070.38720.82
5.6.210.0270.29720.55
5.6.200.0030.40318.19
5.6.190.0170.29020.43
5.6.180.0430.33020.34
5.6.170.0130.39020.50
5.6.160.0000.31320.47
5.6.150.0130.33018.14
5.6.140.0100.35018.21
5.6.130.0100.36018.20
5.6.120.0100.34721.09
5.6.110.0030.47721.00
5.6.100.0100.35721.14
5.6.90.0070.39721.04
5.6.80.0070.28020.54
5.6.70.3730.29020.48
5.5.350.0130.36020.47
5.5.340.0100.34718.07
5.5.330.0070.33020.19
5.5.320.0400.29020.44
5.5.310.0230.28320.21
5.5.300.0070.34017.88
5.5.290.0000.29717.98
5.5.280.0100.35720.89
5.5.270.0030.29020.77
5.5.260.0070.39020.87
5.5.250.0170.35020.56
5.5.240.0130.31320.27
5.4.450.0000.30019.25
5.4.440.0100.31319.41
5.4.430.0030.29019.14
5.4.420.0070.29719.13
5.4.410.0000.27019.25
5.4.400.0030.26019.15
5.4.390.0000.26019.12
5.4.380.0030.26019.15
5.4.370.0100.25318.81
5.4.360.0030.26719.14
5.4.350.0070.35019.00
5.4.340.0070.32719.17
5.4.320.0030.36319.18
5.4.310.0000.29718.97
5.4.300.0000.31318.79
5.4.290.0100.31719.11
5.4.280.0070.36319.18
5.4.270.0030.34719.09
5.4.260.0070.33319.13
5.4.250.0170.28318.91
5.4.240.0130.32319.11
5.4.230.0100.30319.15
5.4.220.0130.32319.11
5.4.210.0070.32719.17
5.4.200.0030.30719.17
5.4.190.0070.32319.09
5.4.180.0100.28019.18
5.4.170.0000.31018.99
5.4.160.0030.27718.77
5.4.150.0130.32019.15
5.4.140.0130.31016.34
5.4.130.0100.33016.19
5.4.120.0030.33716.38
5.4.110.0030.30716.36
5.4.100.0030.31716.36
5.4.90.0670.27016.36
5.4.80.0070.33716.22
5.4.70.0070.32316.59
5.4.60.0030.27716.34
5.4.50.0070.33716.34
5.4.40.0030.28716.24
5.4.30.0070.36316.57
5.4.20.0030.33716.29
5.4.10.0070.30016.25
5.4.00.0030.29715.66
5.3.290.0070.37014.60
5.3.280.0170.34714.55
5.3.270.0170.32714.56
5.3.260.0130.35714.54
5.3.250.0130.28314.56
5.3.240.0130.33014.57
5.3.230.0100.29314.54
5.3.220.0000.36314.50
5.3.210.0100.33714.39
5.3.200.0070.33014.55
5.3.190.0000.32714.50
5.3.180.0100.33714.50
5.3.170.0070.33714.52
5.3.160.0070.34014.51
5.3.150.0030.32714.52
5.3.140.0070.34714.58
5.3.130.0000.30314.51
5.3.120.0030.37014.44
5.3.110.0000.29714.55
5.3.100.0000.35314.06
5.3.90.0030.33013.82
5.3.80.0130.32313.96
5.3.70.0130.35013.96
5.3.60.0000.33013.95
5.3.50.0030.30713.93
5.3.40.0030.28013.89
5.3.30.0070.34713.88
5.3.20.0070.34713.52
5.3.10.0000.33313.62
5.3.00.0000.35713.48
5.2.170.0070.28711.05
5.2.160.0030.28311.15
5.2.150.0100.35011.14
5.2.140.0000.29711.15
5.2.130.0000.32011.00
5.2.120.0070.32011.05
5.2.110.0030.30011.19
5.2.100.0070.33011.12
5.2.90.0030.33311.12
5.2.80.0030.35311.00
5.2.70.0070.35710.93
5.2.60.0000.31311.05
5.2.50.0030.30010.92
5.2.40.0000.33710.89
5.2.30.0000.35010.97
5.2.20.0100.35310.90
5.2.10.0000.39010.90
5.2.00.0030.35310.89
5.1.60.0030.3279.96
5.1.50.0100.36010.14
5.1.40.0100.35010.14
5.1.30.0000.38710.34
5.1.20.0100.35710.25
5.1.10.0030.36010.04
5.1.00.0030.30710.09
5.0.50.0000.5008.71
5.0.40.0000.5778.57
5.0.30.0000.5008.20
5.0.20.0000.4938.14
5.0.10.0000.5408.09
5.0.00.0000.6608.21
4.4.90.0070.4938.14
4.4.80.0030.5408.14
4.4.70.0000.5438.14
4.4.60.0000.5578.14
4.4.50.0030.5608.14
4.4.40.0000.5638.14
4.4.30.0000.5308.14
4.4.20.0000.5208.14
4.4.10.0000.4878.14
4.4.00.0000.5178.14
4.3.110.0030.4738.14
4.3.100.0000.4738.14
4.3.90.0030.4908.14
4.3.80.0000.6437.89
4.3.70.0000.5607.89
4.3.60.0030.5577.89
4.3.50.0000.5537.89
4.3.40.0000.7037.89
4.3.30.0000.5577.89
4.3.20.0000.4807.89
4.3.10.0030.4977.89
4.3.00.0000.6237.89

preferences:
34.96 ms | 401 KiB | 5 Q