3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iterations = 1000000; $strOne = '1'; $strEmpty = ''; $times = ['oneOpEq' => 0, 'oneSlen' => 0, 'empOpEq' => 0, 'empSlen' => 0]; $x = $iterations; $start = microtime(true); while ($x--) { $y = ($strOne === '1'); } $times['oneOpEq'] = microtime(true) - $start; $x = $iterations; $start = microtime(true); while ($x--) { $y = (strlen($strOne) == 0); } $times['oneSlen'] = microtime(true) - $start; $x = $iterations; $start = microtime(true); while ($x--) { $y = ($strEmpty === ''); } $times['empOpEq'] = microtime(true) - $start; $x = $iterations; $start = microtime(true); while ($x--) { $y = (strlen($strEmpty) == 0); } $times['empSlen'] = microtime(true) - $start; var_dump($times);

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.0050.07714.75
7.3.120.0030.09814.63
7.3.110.0100.09214.79
7.3.100.0080.08115.00
7.3.90.0020.08214.83
7.3.80.0100.07514.77
7.3.70.0030.09514.91
7.3.60.0070.07514.67
7.3.50.0050.08614.89
7.3.40.0080.07314.92
7.3.30.0030.08014.77
7.3.20.0030.07716.62
7.3.10.0080.07616.52
7.3.00.0060.07416.69
7.2.250.0080.11115.02
7.2.240.0080.09215.09
7.2.230.0110.07515.17
7.2.220.0080.07215.09
7.2.210.0050.08714.83
7.2.200.0020.08214.95
7.2.190.0050.08915.17
7.2.180.0050.07415.12
7.2.170.0030.07714.95
7.2.160.0030.07215.23
7.2.150.0100.06816.92
7.2.140.0000.07917.04
7.2.130.0080.07417.04
7.2.120.0070.07816.94
7.2.110.0050.08916.82
7.2.100.0030.07716.97
7.2.90.0030.07716.90
7.2.80.0100.07216.96
7.2.70.0050.07416.88
7.2.60.0090.07516.92
7.2.50.0080.07616.87
7.2.40.0050.07416.89
7.2.30.0050.07516.96
7.2.20.0050.07916.85
7.2.10.0050.08716.78
7.2.00.0040.08217.75
7.1.330.0030.20815.80
7.1.320.0050.18815.78
7.1.310.0070.20515.88
7.1.300.0030.21215.64
7.1.290.0050.20115.96
7.1.280.0030.20215.94
7.1.270.0080.18215.79
7.1.260.0030.18415.99
7.1.250.0030.19115.71
7.1.240.0070.19916.01
7.1.230.0030.18915.79
7.1.220.0100.21115.84
7.1.210.0100.17515.64
7.1.200.0000.18715.70
7.1.190.0030.22015.81
7.1.180.0000.18415.89
7.1.170.0070.21615.84
7.1.160.0070.21015.82
7.1.150.0030.25215.93
7.1.140.0070.23015.92
7.1.130.0000.18215.90
7.1.120.0070.18015.45
7.1.110.0000.20415.87
7.1.100.0100.13217.06
7.1.90.0070.18416.03
7.1.80.0000.21415.51
7.1.70.0030.14616.61
7.1.60.0120.16625.38
7.1.50.0060.19025.31
7.1.40.0080.16225.12
7.1.30.0120.15925.17
7.1.20.0100.14825.24
7.1.10.0050.15516.24
7.1.00.0020.17516.22
7.0.330.0030.22615.37
7.0.320.0030.23315.42
7.0.310.0000.20415.49
7.0.300.0030.18515.27
7.0.290.0070.18215.57
7.0.280.0070.19515.39
7.0.270.0100.17715.25
7.0.260.0000.18415.45
7.0.250.0000.19315.60
7.0.240.0030.21515.19
7.0.230.0000.23215.56
7.0.220.0130.19415.08
7.0.210.0030.18515.14
7.0.200.0100.14915.14
7.0.190.0080.16615.91
7.0.180.0050.18315.84
7.0.170.0070.16715.85
7.0.160.0050.15315.67
7.0.150.0030.15715.78
7.0.140.0000.15315.87
7.0.130.0000.14715.90
7.0.120.0080.14716.06
7.0.110.0080.13915.90
7.0.100.0020.14915.83
7.0.90.0100.14916.03
7.0.80.0050.14716.04
7.0.70.0020.15815.84
7.0.60.0030.14615.80
7.0.50.0020.16615.82
7.0.40.0050.17115.14
7.0.30.0080.18615.20
7.0.20.0030.15415.26
7.0.10.0050.14415.33
7.0.00.0050.14915.20
5.6.400.0030.52514.76
5.6.390.0030.53614.68
5.6.380.0070.50414.44
5.6.370.0030.51814.45
5.6.360.0070.47614.18
5.6.350.0070.53014.30
5.6.340.0030.56714.56
5.6.330.0030.56714.51
5.6.320.0000.52714.22
5.6.310.0070.54914.17
5.6.300.0000.58014.39
5.6.290.0070.65014.27
5.6.280.0030.65214.70
5.6.270.0000.60614.44
5.6.260.0100.50614.64
5.6.250.0030.57514.10
5.6.240.0000.57914.28
5.6.230.0000.51414.71
5.6.220.0070.64214.57
5.6.210.0070.53214.51
5.6.200.0030.49914.10
5.6.190.0000.56814.34
5.6.180.0070.50514.34
5.6.170.0000.56114.28
5.6.160.0030.51914.10
5.6.150.0030.58514.10
5.6.140.0030.49114.44
5.6.130.0000.59614.56
5.6.120.0070.59314.29
5.6.110.0070.50614.29
5.6.100.0070.56114.43
5.6.90.0030.66514.46
5.6.80.0070.49014.49
5.6.70.0100.57214.17
5.6.60.0030.54114.10
5.6.50.0000.53914.30
5.6.40.0070.56414.43
5.6.30.0070.50614.46
5.6.20.0070.51014.41
5.6.10.0100.49514.28
5.6.00.0030.47614.50

preferences:
36.67 ms | 401 KiB | 5 Q