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: $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.4.10.0130.09314.91
7.4.00.0050.14214.86
7.3.130.0070.07714.78
7.3.120.0050.14114.88
7.3.110.0070.11114.85
7.3.100.0100.11214.62
7.3.90.0050.08614.93
7.3.80.0030.11214.78
7.3.70.0080.09014.88
7.3.60.0070.07914.79
7.3.50.0050.10314.74
7.3.40.0080.08114.77
7.3.30.0070.10314.87
7.3.20.0050.08816.46
7.3.10.0060.08116.66
7.3.00.0080.09416.50
7.2.260.0030.16815.02
7.2.250.0110.13115.13
7.2.240.0070.13015.07
7.2.230.0110.10614.92
7.2.220.0050.11415.01
7.2.210.0080.10915.14
7.2.200.0080.09514.93
7.2.190.0050.09615.03
7.2.180.0050.11015.10
7.2.170.0100.11314.84
7.2.160.0030.09615.03
7.2.150.0110.10216.86
7.2.140.0080.08816.98
7.2.130.0080.10816.81
7.2.120.0070.10516.92
7.2.110.0070.10616.90
7.2.100.0000.12016.92
7.2.90.0080.09717.08
7.2.80.0050.11017.00
7.2.70.0030.10916.96
7.2.60.0000.11416.85
7.2.50.0070.11716.92
7.2.40.0030.10016.96
7.2.30.0030.10516.88
7.2.20.0030.11016.90
7.2.10.0070.12617.00
7.2.00.0040.09017.59
7.1.330.0070.17315.68
7.1.320.0050.17415.51
7.1.310.0030.14815.88
7.1.300.0030.16615.84
7.1.290.0020.15315.76
7.1.280.0030.17815.72
7.1.270.0050.16015.83
7.1.260.0080.14715.67
7.1.250.0020.17015.78
7.1.240.0050.15815.86
7.1.230.0080.16415.72
7.1.220.0070.14115.90
7.1.210.0050.14815.98
7.1.200.0080.13315.69
7.1.190.0030.15015.57
7.1.180.0100.15315.73
7.1.170.0020.15415.63
7.1.160.0070.13915.83
7.1.150.0030.14915.86
7.1.140.0050.15715.97
7.1.130.0030.15615.87
7.1.120.0070.15115.71
7.1.110.0050.14715.92
7.1.100.0070.16215.61
7.1.90.0070.14915.71
7.1.80.0070.14515.87
7.1.70.0010.13416.21
7.1.60.0070.14316.95
7.1.50.0100.15022.16
7.1.40.0020.16415.74
7.1.30.0030.15915.63
7.1.20.0020.15015.73
7.1.10.0070.16615.63
7.1.00.0080.12418.02
7.0.330.0070.15815.35
7.0.320.0000.15515.28
7.0.310.0030.15415.37
7.0.300.0070.14215.29
7.0.290.0050.14915.36
7.0.280.0020.15915.42
7.0.270.0020.13615.54
7.0.260.0050.16015.24
7.0.250.0080.16215.12
7.0.240.0030.15015.30
7.0.230.0050.13715.49
7.0.220.0070.13715.36
7.0.210.0020.16015.46
7.0.200.0020.13115.97
7.0.190.0070.17115.46
7.0.180.0050.16115.40
7.0.170.0070.16215.35
7.0.160.0050.13915.41
7.0.150.0030.16415.40
7.0.140.0100.15217.61
7.0.130.0030.14415.58
7.0.120.0080.15917.68
7.0.110.0030.14715.56
7.0.100.0030.16615.44
7.0.90.0050.14215.52
7.0.80.0080.13415.44
7.0.70.0030.17115.46
7.0.60.0030.13916.96
7.0.50.0030.15516.24
7.0.40.0020.14015.66
7.0.30.0130.14015.78
7.0.20.0120.14715.70
7.0.10.0110.17015.76
7.0.00.0080.13315.70
5.6.400.0030.28814.19
5.6.390.0030.29314.31
5.6.380.0050.28014.45
5.6.370.0030.28514.34
5.6.360.0070.26714.18
5.6.350.0020.26414.41
5.6.340.0030.26314.15
5.6.330.0020.26314.55
5.6.320.0020.25614.43
5.6.310.0020.27814.59
5.6.300.0100.24414.39
5.6.290.0070.27314.23
5.6.280.0010.27516.67
5.6.270.0030.25914.40
5.6.260.0030.28414.47
5.6.250.0080.26814.30
5.6.240.0020.27314.43
5.6.230.0030.28814.28
5.6.220.0030.24414.24
5.6.210.0060.23116.38
5.6.200.0030.23415.62
5.6.190.0030.22716.40
5.6.180.0100.25316.44
5.6.170.0070.23716.23
5.6.160.0040.24616.42
5.6.150.0070.25415.69
5.6.140.0060.24315.66
5.6.130.0030.22515.60
5.6.120.0030.28216.50
5.6.110.0080.24616.67
5.6.100.0110.23716.51
5.6.90.0080.25916.63
5.6.80.0020.28016.29
5.6.70.0070.28114.16
5.6.60.0100.27014.20
5.6.50.0070.26614.04
5.6.40.0050.29114.37
5.6.30.0020.23914.05
5.6.20.0050.28314.30
5.6.10.0030.26414.23
5.6.00.0050.27214.25
5.5.380.0030.26914.24
5.5.370.0030.26314.22
5.5.360.0030.25414.12
5.5.350.0140.25316.33
5.5.340.0060.23415.53
5.5.330.0100.23116.28
5.5.320.0100.23916.26
5.5.310.0100.24616.33
5.5.300.0010.26015.34
5.5.290.0060.25615.43
5.5.280.0090.23616.46
5.5.270.0080.24416.38
5.5.260.0110.23816.48
5.5.250.0070.25316.24
5.5.240.0070.28516.18
5.5.230.0000.28314.12
5.5.220.0000.27114.10
5.5.210.0030.27514.36
5.5.200.0030.26214.20
5.5.190.0030.29314.17
5.5.180.0070.25014.20
5.5.170.0050.27614.26
5.5.160.0030.27114.19
5.5.150.0050.26514.04
5.5.140.0050.24514.28
5.5.130.0050.28914.30
5.5.120.0000.27814.17
5.5.110.0050.29114.19
5.5.100.0030.25214.08
5.5.90.0030.26814.29
5.5.80.0030.26314.21
5.5.70.0070.24514.07
5.5.60.0050.30114.01
5.5.50.0070.31013.94
5.5.40.0030.29614.06
5.5.30.0100.25514.34
5.5.20.0080.27114.17
5.5.10.0030.25614.25
5.5.00.0080.25214.13
5.4.450.0020.25414.08
5.4.440.0090.23514.13
5.4.430.0040.24014.14
5.4.420.0020.23214.02
5.4.410.0010.25014.11
5.4.400.0040.23713.85
5.4.390.0060.24813.97
5.4.380.0070.25813.82
5.4.370.0030.23514.05
5.4.360.0030.23013.97
5.4.350.0040.23413.95
5.4.340.0040.26714.00
5.4.330.0030.26211.34
5.4.320.0080.24313.88
5.4.310.0080.22614.03
5.4.300.0030.24613.77
5.4.290.0020.23514.05
5.4.280.0020.22713.94
5.4.270.0040.26013.99
5.4.260.0010.26813.89
5.4.250.0010.24214.00
5.4.240.0010.25014.05
5.4.230.0040.22213.89
5.4.220.0020.25513.86
5.4.210.0100.24914.06
5.4.200.0030.23913.78
5.4.190.0010.26513.95
5.4.180.0040.24214.00
5.4.170.0060.23213.89
5.4.160.0020.25614.02
5.4.150.0030.21713.93
5.4.140.0010.23413.06
5.4.130.0020.24613.03
5.4.120.0080.25013.07
5.4.110.0020.23213.17
5.4.100.0020.23413.08
5.4.90.0030.24413.07
5.4.80.0090.24512.96
5.4.70.0020.24613.12
5.4.60.0020.26213.07
5.4.50.0040.25513.04
5.4.40.0080.23013.01
5.4.30.0030.26213.05
5.4.20.0030.23012.99
5.4.10.0040.22213.13
5.4.00.0040.23912.81
5.3.290.0040.26712.35
5.3.280.0070.26512.29
5.3.270.0040.27512.21
5.3.260.0010.27712.27
5.3.250.0020.24712.35
5.3.240.0020.25412.19
5.3.230.0070.24412.20
5.3.220.0030.24912.21
5.3.210.0040.24512.30
5.3.200.0030.25112.25
5.3.190.0020.26512.21
5.3.180.0010.27512.29
5.3.170.0040.29312.24
5.3.160.0020.25412.33
5.3.150.0000.25612.30
5.3.140.0000.28112.28
5.3.130.0020.26512.21
5.3.120.0040.24112.27
5.3.110.0070.25212.28
5.3.100.0060.28212.17
5.3.90.0090.29412.08
5.3.80.0020.26911.99
5.3.70.0020.27612.08
5.3.60.0020.27312.11
5.3.50.0010.26912.07
5.3.40.0030.26111.94
5.3.30.0030.26312.09
5.3.20.0020.25811.98
5.3.10.0020.25211.90
5.3.00.0060.24811.84
5.2.170.0070.16011.24
5.2.160.0030.22311.08
5.2.150.0070.21711.03
5.2.140.0000.17311.30
5.2.130.0100.23711.04
5.2.120.0070.22311.00
5.2.110.0030.22711.25
5.2.100.0070.22011.11
5.2.90.0070.23311.04
5.2.80.0030.18011.03
5.2.70.0100.21011.07
5.2.60.0030.22711.13
5.2.50.0030.26711.10
5.2.40.0030.16310.98
5.2.30.0030.21310.79
5.2.20.0100.21310.89
5.2.10.0130.20310.85
5.2.00.0030.20010.85
5.1.60.0130.22310.05
5.1.50.0070.2409.96
5.1.40.0070.21710.05
5.1.30.0030.23010.40
5.1.20.0070.21310.31
5.1.10.0030.21010.01
5.1.00.0030.21710.21
5.0.50.0030.3408.57
5.0.40.0030.3378.52
5.0.30.0030.3308.30
5.0.20.0030.2738.34
5.0.10.0000.3208.09
5.0.00.0000.2738.14
4.4.90.0030.2737.53
4.4.80.0030.2707.53
4.4.70.0030.2637.53
4.4.60.0030.3307.53
4.4.50.0030.3407.53
4.4.40.0000.3337.53
4.4.30.0030.3107.53
4.4.20.0000.2977.53
4.4.10.0000.3477.53
4.4.00.0000.3407.53
4.3.110.0030.3377.53
4.3.100.0030.3437.53
4.3.90.0030.3277.53
4.3.80.0000.3337.53
4.3.70.0000.2777.53
4.3.60.0000.2707.53
4.3.50.0030.2777.53
4.3.40.0070.3337.53
4.3.30.0000.2677.53
4.3.20.0030.3277.53
4.3.10.0030.3037.53
4.3.00.0030.2677.53

preferences:
32.21 ms | 401 KiB | 5 Q