3v4l.org

run code in 300+ PHP versions simultaneously
<?php global $throw; $throw = false; function foo() { bar(); } function bar() { baz(); } function baz() { boom(); } function boom() { global $throw; if ($throw) { throw new RuntimeException(); } } function test($n) { for ($i = 0; $i < $n; $i++) { try { foo(); } catch (RuntimeException $e) { return false; } } } $n = 1000000; $t = microtime(true); test($n); echo (microtime(true) - $t)*1000000/$n . ' us/iteration';

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.0100.11715.06
7.4.00.0060.13014.79
7.3.130.0030.16114.63
7.3.120.0030.16114.93
7.3.110.0070.15714.87
7.3.100.0030.12214.65
7.3.90.0070.13015.03
7.3.80.0030.12315.05
7.3.70.0100.10914.79
7.3.60.0070.10314.89
7.3.50.0030.11715.00
7.3.40.0060.10414.64
7.3.30.0030.10814.77
7.3.20.0030.10416.73
7.3.10.0050.11916.61
7.3.00.0080.12416.60
7.2.260.0030.13114.74
7.2.250.0050.17514.99
7.2.240.0070.14815.03
7.2.230.0070.15615.25
7.2.220.0030.17715.23
7.2.210.0030.12515.02
7.2.200.0130.12715.11
7.2.190.0030.15814.82
7.2.180.0000.13014.89
7.2.170.0000.12415.03
7.2.160.0030.12715.06
7.2.150.0000.13516.99
7.2.140.0070.12816.67
7.2.130.0030.12616.85
7.2.120.0030.12816.99
7.2.110.0070.12816.88
7.2.100.0050.12816.86
7.2.90.0070.12416.85
7.2.80.0030.12916.97
7.2.70.0050.13216.96
7.2.60.0020.13716.94
7.2.50.0030.12716.79
7.2.40.0000.12617.02
7.2.30.0070.12116.82
7.2.20.0050.12516.77
7.2.10.0070.12417.05
7.2.00.0030.11317.83
7.1.330.0070.26215.65
7.1.320.0030.26115.71
7.1.310.0030.23015.73
7.1.300.0030.24415.84
7.1.290.0030.24015.79
7.1.280.0070.24715.64
7.1.270.0130.27916.00
7.1.260.0070.24616.06
7.1.250.0030.24815.82
7.1.240.0000.24715.68
7.1.230.0000.23715.75
7.1.220.0030.24215.73
7.1.210.0030.25415.96
7.1.200.0030.23515.66
7.1.190.0100.22615.88
7.1.180.0070.24315.86
7.1.170.0060.23515.88
7.1.160.0000.25315.71
7.1.150.0070.23415.72
7.1.140.0100.23215.79
7.1.130.0000.23816.02
7.1.120.0030.23315.82
7.1.110.0030.23315.64
7.1.100.0100.22615.95
7.1.90.0030.24615.80
7.1.80.0030.23315.64
7.1.70.0080.17016.24
7.1.60.0080.19317.79
7.1.50.0050.18316.48
7.1.40.0070.25215.97
7.1.30.0030.23115.58
7.1.20.0000.22615.52
7.1.10.0000.23615.81
7.1.00.0030.22319.16
7.0.330.0030.22315.09
7.0.320.0070.22915.50
7.0.310.0100.26515.35
7.0.300.0030.24815.49
7.0.290.0000.23015.43
7.0.280.0030.23115.22
7.0.270.0030.21815.40
7.0.260.0000.22615.46
7.0.250.0070.24715.55
7.0.240.0070.26415.29
7.0.230.0030.23115.55
7.0.220.0030.23115.52
7.0.210.0030.25415.41
7.0.200.0020.18616.13
7.0.190.0030.27515.23
7.0.180.0030.24815.11
7.0.170.0070.22615.16
7.0.160.0000.22815.49
7.0.150.0030.25515.33
7.0.140.0050.23318.72
7.0.130.0070.26915.36
7.0.120.0030.25115.38
7.0.110.0000.25415.55
7.0.100.0030.25715.43
7.0.90.0000.26215.32
7.0.80.0070.20117.79
7.0.70.0200.18417.70
7.0.60.0000.21117.66
7.0.50.0120.18417.85
7.0.40.0050.17816.85
7.0.30.0070.21216.74
7.0.20.0130.21416.82
7.0.10.0000.22216.73
7.0.00.0050.20216.72
5.6.400.0070.37814.41
5.6.390.0030.39214.56
5.6.380.0000.42114.30
5.6.370.0030.41214.47
5.6.360.0030.43114.47
5.6.350.0030.40713.99
5.6.340.0030.43114.38
5.6.330.0030.44914.51
5.6.320.0070.51214.53
5.6.310.0030.41314.42
5.6.300.0070.45514.66
5.6.290.0100.47814.24
5.6.280.0080.40617.76
5.6.270.0070.48714.59
5.6.260.0070.38814.04
5.6.250.0100.39514.31
5.6.240.0100.39714.31
5.6.230.0070.35517.44
5.6.220.0080.40217.53
5.6.210.0050.38117.42
5.6.200.0070.37217.75
5.6.190.0080.39217.76
5.6.180.0070.43317.53
5.6.170.0070.33517.84
5.6.160.0030.37317.78
5.6.150.0080.37117.71
5.6.140.0070.35817.63
5.6.130.0070.40917.67
5.6.120.0020.36517.53
5.6.110.0020.34317.83
5.6.100.0050.34217.58
5.6.90.0050.41317.65
5.6.80.0080.39917.42
5.6.70.0070.36917.28
5.6.60.0020.37717.24
5.6.50.0070.37617.37
5.6.40.0080.35117.54
5.6.30.0050.41917.55
5.6.20.0050.42517.45
5.6.10.0120.42517.40
5.6.00.0080.36517.24
5.5.380.0030.43814.02
5.5.370.0070.38817.33
5.5.360.0070.41517.41
5.5.350.0260.33917.32
5.5.340.0030.36817.56
5.5.330.0120.41017.57
5.5.320.0100.37217.51
5.5.310.0080.37717.72
5.5.300.0070.32717.73
5.5.290.0150.40617.64
5.5.280.0070.37517.69
5.5.270.0030.33917.52
5.5.260.0120.36717.55
5.5.250.0020.35817.54
5.5.240.0120.40517.13
5.5.230.0080.38817.11
5.5.220.0130.41217.14
5.5.210.0130.39417.34
5.5.200.0080.36617.34
5.5.190.0120.37217.32
5.5.180.0070.40317.12
5.5.170.0100.42214.20
5.5.160.0050.39317.02
5.5.150.0030.36917.33
5.5.140.0120.36917.18
5.5.130.0020.38217.17
5.5.120.0070.35817.23
5.5.110.0030.36717.11
5.5.100.0050.36217.10
5.5.90.0030.32417.15
5.5.80.0030.33917.03
5.5.70.0050.33117.29
5.5.60.0070.34616.95
5.5.50.0050.37317.19
5.5.40.0070.37017.14
5.5.30.0070.36017.13
5.5.20.0080.35517.23
5.5.10.0050.31917.12
5.5.00.0080.35916.98
5.4.450.0080.41915.32
5.4.440.0070.32915.25
5.4.430.0080.35115.23
5.4.420.0050.40715.29
5.4.410.0050.35215.12
5.4.400.0000.40415.06
5.4.390.0080.36814.94
5.4.380.0070.39814.91
5.4.370.0030.34814.98
5.4.360.0070.38314.87
5.4.350.0100.40415.18
5.4.340.0070.43015.16
5.4.330.0030.47011.05
5.4.320.0070.35615.00
5.4.310.0050.38315.18
5.4.300.0030.41015.11
5.4.290.0050.43315.02
5.4.280.0050.36914.88
5.4.270.0030.35714.97
5.4.260.0020.35015.08
5.4.250.0000.33415.05
5.4.240.0030.32914.91
5.4.230.0030.33015.13
5.4.220.0020.39515.12
5.4.210.0070.35615.04
5.4.200.0070.39115.01
5.4.190.0070.35815.07
5.4.180.0050.34415.11
5.4.170.0070.38415.01
5.4.160.0070.37015.01
5.4.150.0050.41615.07
5.4.140.0080.36413.69
5.4.130.0050.35913.57
5.4.120.0080.38113.96
5.4.110.0020.36013.77
5.4.100.0080.34813.81
5.4.90.0030.40413.62
5.4.80.0070.40013.60
5.4.70.0050.40913.85
5.4.60.0070.34913.71
5.4.50.0070.39913.69
5.4.40.0050.38913.82
5.4.30.0020.42913.80
5.4.20.0050.37613.74
5.4.10.0030.41213.74
5.4.00.0020.35113.44
5.3.290.0080.58412.53
5.3.280.0100.58212.65
5.3.270.0130.60012.75
5.3.260.0050.62112.58
5.3.250.0080.59712.43
5.3.240.0100.63512.59
5.3.230.0070.59612.64
5.3.220.0100.56912.38
5.3.210.0120.55512.48
5.3.200.0070.58512.50
5.3.190.0120.61212.47
5.3.180.0070.61212.52
5.3.170.0160.56112.56
5.3.160.0030.63012.55
5.3.150.0070.55112.62
5.3.140.0110.51612.60
5.3.130.0100.54212.52
5.3.120.0070.60712.58
5.3.110.0050.62412.63
5.3.100.0130.55812.32
5.3.90.0160.57012.21
5.3.80.0100.60912.28
5.3.70.0070.53412.27
5.3.60.0080.58612.23
5.3.50.0070.59512.30
5.3.40.0050.59912.17
5.3.30.0060.61012.31
5.3.20.0020.53412.02
5.3.10.0050.50812.07
5.3.00.0070.55712.00
5.2.170.0000.74311.49
5.2.160.0030.76711.49
5.2.150.0130.78011.49
5.2.140.0000.64311.49
5.2.130.0000.58711.49
5.2.120.0030.66711.49
5.2.110.0130.68011.49
5.2.100.0000.76311.49
5.2.90.0030.65311.49
5.2.80.0070.59011.49
5.2.70.0030.70711.49
5.2.60.0000.68311.49
5.2.50.0100.77311.49
5.2.40.0070.65711.49
5.2.30.0030.79311.49
5.2.20.0000.67311.49
5.2.10.0070.77011.49
5.2.00.0030.78011.49
5.1.60.0070.70711.49
5.1.50.0130.80011.49
5.1.40.0000.81011.49
5.1.30.0000.80711.49
5.1.20.0100.79311.49
5.1.10.0070.80711.49
5.1.00.0030.82311.49
5.0.50.0030.04011.49
5.0.40.0030.04711.49
5.0.30.0030.05011.49
5.0.20.0030.04711.49
5.0.10.0030.04011.49
5.0.00.0000.04711.49
4.4.90.0030.03011.49
4.4.80.0030.03311.49
4.4.70.0000.04011.49
4.4.60.0000.03711.49
4.4.50.0000.03711.49
4.4.40.0000.05011.49
4.4.30.0000.03311.49
4.4.20.0100.03011.49
4.4.10.0000.04011.49
4.4.00.0070.05011.49
4.3.110.0030.03711.49
4.3.100.0000.02311.49
4.3.90.0000.03711.49
4.3.80.0070.05011.49
4.3.70.0030.02311.49
4.3.60.0000.02011.49
4.3.50.0030.03311.49
4.3.40.0000.05311.49
4.3.30.0030.03011.49
4.3.20.0100.02011.49
4.3.10.0000.03711.49
4.3.00.0000.03711.49

preferences:
16.28 ms | 403 KiB | 5 Q