3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cases = array(false, 0, 1, 2, 3, 4, 5, true, null); $result = array(); $ln = 10000; $s = microtime(true); for ($i = 0; $i < $ln; $i++) { foreach ($cases as $c) { $result['case_' . json_encode($c)] = !!$c; } } var_dump('time : ' . (microtime(true) - $s) . ' for ' . $ln . ' times !!$c on each case, result:', $result); $s = microtime(true); for ($i = 0; $i < $ln; $i++) { foreach ($cases as $c) { $result['case_' . json_encode($c)] = (bool)$c; } } var_dump('time : ' . (microtime(true) - $s) . ' for ' . $ln . ' times (bool)$c on each case, result:', $result);

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.04319.45
7.1.70.0030.02817.22
7.1.60.0030.06419.17
7.1.50.0070.05116.69
7.1.00.0070.06022.48
7.0.200.0030.02616.52
7.0.140.0130.09722.07
7.0.90.0630.10719.94
7.0.80.0470.10319.87
7.0.70.0300.07719.95
7.0.60.0530.07719.90
7.0.50.0570.11020.21
7.0.40.0070.08020.07
7.0.30.0100.11020.11
7.0.20.0200.10320.11
7.0.10.0170.10319.92
7.0.00.0030.08020.17
5.6.280.0030.18720.88
5.6.240.0100.14020.46
5.6.230.0070.11020.46
5.6.220.0100.12020.63
5.6.210.0070.07720.45
5.6.200.0130.07321.09
5.6.190.0130.07721.04
5.6.180.0030.08720.96
5.6.170.0070.08020.96
5.6.160.0130.14021.04
5.6.150.0030.09721.11
5.6.140.0070.12721.17
5.6.130.0030.09320.92
5.6.120.0170.08320.95
5.6.110.0070.14021.04
5.6.100.0230.12021.07
5.6.90.0030.12020.94
5.6.80.0000.08720.35
5.6.70.0100.12720.30
5.6.60.0100.12320.42
5.6.50.0000.08020.41
5.6.40.0100.13320.40
5.6.30.0070.07720.32
5.6.20.0070.13720.29
5.6.10.0230.10720.43
5.6.00.0030.07720.36
5.5.380.0130.12320.47
5.5.370.0170.09320.38
5.5.360.0070.08320.39
5.5.350.0100.07320.41
5.5.340.0130.08320.83
5.5.330.0030.08720.91
5.5.320.0070.08020.80
5.5.310.0100.12320.87
5.5.300.0100.13020.90
5.5.290.0100.14020.90
5.5.280.0030.08020.81
5.5.270.0100.08020.79
5.5.260.0070.09020.77
5.5.250.0070.08020.59
5.5.240.0100.10020.14
5.5.230.0100.13320.11
5.5.220.0130.13020.26
5.5.210.0000.08320.30
5.5.200.0130.11720.27
5.5.190.0000.13720.19
5.5.180.0070.12720.14
5.5.160.0070.15720.18
5.5.150.0070.09320.08
5.5.140.0170.08720.23
5.5.130.0070.07720.19
5.5.120.0100.10320.18
5.5.110.0030.07720.11
5.5.100.0000.08320.05
5.5.90.0070.10319.95
5.5.80.0100.07020.08
5.5.70.0100.06320.17
5.5.60.0100.07020.06
5.5.50.0070.13020.10
5.5.40.0070.08020.05
5.5.30.0000.07720.05
5.5.20.0000.08719.99
5.5.10.0070.07720.01
5.5.00.0030.08320.03
5.4.450.0100.07719.45
5.4.440.0030.13719.30
5.4.430.0170.12719.36
5.4.420.0030.13719.56
5.4.410.0030.07719.26
5.4.400.0070.07318.81
5.4.390.0070.11019.05
5.4.380.0030.07719.05
5.4.370.0070.12719.03
5.4.360.0100.12319.03
5.4.350.0070.07319.03
5.4.340.0200.11718.79
5.4.320.0000.08719.00
5.4.310.0100.09318.94
5.4.300.0070.08018.98
5.4.290.0070.07319.03
5.4.280.0000.07718.78
5.4.270.0030.08718.90
5.4.260.0070.07019.22
5.4.250.0000.07719.02
5.4.240.0100.06019.06
5.4.230.0100.10319.22
5.4.220.0070.07019.11
5.4.210.0070.08318.78
5.4.200.0000.07319.07
5.4.190.0070.07719.07
5.4.180.0030.07718.87
5.4.170.0030.07318.96
5.4.160.0000.07719.12
5.4.150.0070.07019.09
5.4.140.0000.07316.23
5.4.130.0030.08316.07
5.4.120.0000.07316.07
5.4.110.0030.12016.21
5.4.100.0100.10716.23
5.4.90.0100.11716.34
5.4.80.0070.12716.38
5.4.70.0070.12716.41
5.4.60.0170.11716.28
5.4.50.0100.11316.21
5.4.40.0100.12316.41
5.4.30.0100.11716.40
5.4.20.0170.11016.29
5.4.10.0100.11316.41
5.4.00.0000.12715.78
5.3.290.0070.07714.63
5.3.280.0100.07014.59
5.3.270.0000.08014.58
5.3.260.0070.08714.48
5.3.250.0000.08714.61
5.3.240.0100.07314.60
5.3.230.0030.07714.59
5.3.220.0070.07314.50
5.3.210.0000.12014.49
5.3.200.0030.13014.55
5.3.190.0070.11714.43
5.3.180.0030.11014.54
5.3.170.0100.13014.53
5.3.160.0130.12314.51
5.3.150.0000.13714.56
5.3.140.0100.09014.43
5.3.130.0100.13314.46
5.3.120.0070.14014.50
5.3.110.0100.11714.56
5.3.100.0170.11313.90
5.3.90.0130.12313.88
5.3.80.0100.11014.01
5.3.70.0070.11313.89
5.3.60.0130.11013.99
5.3.50.0130.09313.71
5.3.40.0070.14013.92
5.3.30.0070.12313.87
5.3.20.0000.10713.56
5.3.10.0000.09313.53
5.3.00.0070.10713.66
5.2.170.0100.12311.15
5.2.160.0070.13311.18
5.2.150.0070.08311.14
5.2.140.0100.12010.97
5.2.130.0000.11310.95
5.2.120.0000.07711.10
5.2.110.0030.12311.11
5.2.100.0000.08010.95
5.2.90.0000.07711.10
5.2.80.0030.11011.05
5.2.70.0070.11011.13
5.2.60.0070.12011.13
5.2.50.0070.07311.02
5.2.40.0100.12010.80
5.2.30.0030.11010.86
5.2.20.0030.07310.82
5.2.10.0070.12710.77
5.2.00.0100.08310.64
5.1.60.0070.05010.00
5.1.50.0070.05010.03
5.1.40.0030.0579.88
5.1.30.0030.05710.40
5.1.20.0030.05710.27
5.1.10.0030.0539.96
5.1.00.0070.0539.91
5.0.50.0070.0309.88
5.0.40.0070.0409.88
5.0.30.0070.0539.88
5.0.20.0070.0409.88
5.0.10.0070.0409.88
5.0.00.0030.0339.88
4.4.90.0000.0379.88
4.4.80.0070.0309.88
4.4.70.0000.0379.88
4.4.60.0030.0339.88
4.4.50.0000.0239.88
4.4.40.0070.0439.88
4.4.30.0030.0379.88
4.4.20.0070.0309.88
4.4.10.0000.0379.88
4.4.00.0030.0539.88
4.3.110.0000.0379.88
4.3.100.0070.0309.88
4.3.90.0000.0379.88
4.3.80.0030.0409.88
4.3.70.0030.0209.88
4.3.60.0000.0179.88
4.3.50.0030.0139.88
4.3.40.0000.0309.88
4.3.30.0000.0209.88
4.3.20.0000.0239.88
4.3.10.0030.0339.88
4.3.00.0030.0309.88

preferences:
38.38 ms | 401 KiB | 5 Q