3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $v = "Not destructed"; public static $something = 0; public function __destruct() { print "A destructed\n"; $this->v = "descructed"; $this->x = new B(); A::$something++; B::$something++; C::$something++; } } class B { public $v = "Not destructed"; public static $something = 0; public function __destruct() { print "B destructed\n"; $this->v = "descructed"; $this->x = new C(); A::$something++; B::$something++; C::$something++; } } class C { public $v = "Not destructed"; public static $something = 0; public function __destruct() { print "C destructed\n"; $this->v = "descructed"; $this->x = new A(); A::$something++; B::$something++; C::$something++; } } function use_some_memory() { $a = "paul tarjan "; $as = []; $bs = []; $cs = []; while (count($as) < 10) { $a .= $a; $as[] = new A(); $bs[] = new B(); $cs[] = new C(); } // deliberate_OOM(); } function deliberate_OOM() { $a = "paul tarjan "; $as = []; $bs = []; $cs = []; while (true) { $a .= $a; $as[] = new A(); $bs[] = new B(); $cs[] = new C(); } } function on_shutdown() { print "A::something =" . A::$something . "\n"; print "B::something =" . B::$something . "\n"; print "C::something =" . C::$something . "\n"; } register_shutdown_function('on_shutdown'); $a = new A(); $b = new B(); $c = new C(); use_some_memory();

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)
8.3.60.0160.00517.25
8.3.50.0070.01922.95
8.3.40.0130.00619.21
8.3.30.0130.01319.51
8.3.20.0040.00420.63
8.3.10.0100.00023.64
8.3.00.0040.00719.38
8.2.180.0110.00716.88
8.2.170.0190.00922.96
8.2.160.0150.00320.89
8.2.150.0030.00724.18
8.2.140.0170.00424.66
8.2.130.0090.00026.16
8.2.120.0090.00021.23
8.2.110.0070.00422.30
8.2.100.0060.00818.59
8.2.90.0030.00719.42
8.2.80.0080.00017.97
8.2.70.0000.01017.88
8.2.60.0040.00418.30
8.2.50.0030.00518.07
8.2.40.0000.00918.53
8.2.30.0000.00818.49
8.2.20.0030.00518.04
8.2.10.0090.00018.42
8.2.00.0030.00517.94
8.1.280.0060.01225.92
8.1.270.0000.01123.46
8.1.260.0070.00426.35
8.1.250.0070.00328.09
8.1.240.0090.00323.65
8.1.230.0150.00020.71
8.1.220.0060.00319.13
8.1.210.0060.00319.05
8.1.200.0080.00418.73
8.1.190.0030.00718.75
8.1.180.0060.00318.73
8.1.170.0060.00320.09
8.1.160.0000.00923.53
8.1.150.0000.00920.29
8.1.140.0030.00618.85
8.1.130.0100.00019.36
8.1.120.0000.00918.96
8.1.110.0000.01018.95
8.1.100.0000.00918.82
8.1.90.0030.00618.82
8.1.80.0070.00318.99
8.1.70.0000.00918.86
8.1.60.0070.00319.08
8.1.50.0060.00318.99
8.1.40.0100.00019.03
8.1.30.0070.00719.13
8.1.20.0070.00319.03
8.1.10.0030.00619.12
8.1.00.0030.00618.84
8.0.300.0090.00018.77
8.0.290.0060.00318.00
8.0.280.0090.00019.72
8.0.270.0030.00618.52
8.0.260.0070.00318.66
8.0.250.0000.00918.20
8.0.240.0090.00018.30
8.0.230.0060.00318.25
8.0.220.0030.00618.18
8.0.210.0090.00018.08
8.0.200.0030.00618.15
8.0.190.0070.00418.13
8.0.180.0050.00518.23
8.0.170.0070.00318.28
8.0.160.0070.00318.21
8.0.150.0000.00918.17
8.0.140.0030.00718.20
8.0.130.0000.00914.70
8.0.120.0060.00318.16
8.0.110.0030.00618.23
8.0.100.0090.00018.13
8.0.90.0060.00318.22
8.0.80.0160.00718.12
8.0.70.0090.00018.10
8.0.60.0080.00318.19
8.0.50.0060.00318.22
8.0.30.0190.01818.36
8.0.20.0230.02018.63
8.0.10.0030.00618.16
8.0.00.0240.00917.96
7.4.330.0070.00015.46
7.4.320.0090.00017.82
7.4.300.0080.00017.70
7.4.290.0060.00317.72
7.4.280.0100.00017.93
7.4.270.0060.00317.80
7.4.260.0100.00017.86
7.4.250.0060.00317.71
7.4.240.0060.00317.80
7.4.230.0060.00317.99
7.4.220.0150.01217.79
7.4.210.0190.01219.32
7.4.200.0030.00717.97
7.4.160.0230.01117.79
7.4.150.0210.01018.05
7.4.140.0140.01817.86
7.4.130.0180.01817.86
7.4.120.0240.01217.88
7.4.110.0300.01217.75
7.4.100.0200.02317.98
7.4.90.0210.01818.55
7.4.80.0180.01219.39
7.4.70.0260.01517.89
7.4.60.0180.01518.07
7.4.50.0090.00017.92
7.4.40.0240.01518.08
7.4.30.0200.01017.85
7.3.330.0000.01014.73
7.3.320.0070.00014.68
7.3.310.0060.00317.67
7.3.300.0060.00317.66
7.3.290.0070.01417.62
7.3.280.0140.01617.66
7.3.270.0240.00617.97
7.3.260.0280.02317.66
7.3.250.0250.00817.87
7.3.240.0160.01617.66
7.3.230.0170.01718.33
7.3.210.0220.02317.75
7.3.200.0150.01519.39
7.3.190.0200.01517.77
7.3.180.0300.01017.66
7.3.170.0210.00617.83
7.3.160.0150.01317.85
7.2.330.0220.02018.14
7.2.320.0210.00618.23
7.2.310.0100.02418.01
7.2.300.0110.01817.96
7.2.290.0070.02618.15
7.2.100.0220.00716.30
7.2.90.3860.00016.48
7.2.80.1590.00716.26
7.2.70.1920.01616.78
7.2.60.1310.00616.49
7.2.50.2050.01317.10
7.2.40.1910.02316.29
7.2.30.0160.01316.44
7.2.20.1760.01616.79
7.2.10.0100.01416.52
7.2.00.1050.01016.33
7.1.220.0490.01016.64
7.1.210.1530.01216.50
7.1.200.1580.00916.23
7.1.190.1600.00916.60
7.1.180.1200.00716.66
7.1.170.1170.00916.30
7.1.160.2080.01617.35
7.1.150.0530.01516.35
7.1.140.0240.00516.56
7.1.130.0680.01016.52
7.1.120.0560.00717.08
7.1.110.0540.01716.91
7.1.100.1770.00917.29
7.1.90.0230.00816.33
7.1.80.0450.02016.74
7.1.70.0370.01516.45
7.1.60.1410.01234.55
7.1.50.1520.01734.84
7.1.40.2960.01934.55
7.1.30.3800.00335.32
7.1.20.2820.01635.17
7.1.10.1220.01316.19
7.1.00.0190.01016.52
7.0.310.1740.00916.69
7.0.300.3870.01016.94
7.0.290.0570.00516.04
7.0.280.0180.00615.69
7.0.270.0210.01216.05
7.0.260.0250.00916.18
7.0.250.0070.01716.79
7.0.240.1210.01315.73
7.0.230.0220.00716.64
7.0.220.1840.01016.39
7.0.210.0300.00715.93
7.0.200.0190.01315.86
7.0.190.0620.01516.24
7.0.180.2610.00616.23
7.0.170.6400.01317.22
7.0.160.5970.01016.80
7.0.150.1120.01815.91
7.0.140.2220.01315.58
7.0.130.2240.00316.68
7.0.120.2090.01316.21
7.0.110.0490.00916.10
7.0.100.0440.00715.73
7.0.90.0250.00616.05
7.0.80.0160.00915.89
7.0.70.0200.01615.95
7.0.60.2450.01216.38
7.0.50.1930.01716.32
7.0.40.2320.00716.05
7.0.30.0400.01315.88
7.0.20.2690.01016.03
7.0.10.0650.01215.63
7.0.00.4160.00316.64
5.6.380.0170.01717.55
5.6.370.0170.01417.28
5.6.360.0260.00916.70
5.6.350.0250.01416.93
5.6.340.0070.01516.80
5.6.330.0170.01417.22
5.6.320.0210.01116.96
5.6.310.0250.01216.81
5.6.300.0210.01216.62
5.6.290.0220.00917.78
5.6.280.0170.01716.83
5.6.270.0150.02116.94
5.6.260.0210.01216.55
5.6.250.0220.00716.66
5.6.240.0180.00616.91
5.6.230.0190.01217.90
5.6.220.0180.01116.52
5.6.210.0220.00916.55
5.6.200.0110.01616.76
5.6.190.0140.01617.50
5.6.180.0150.01916.59
5.6.170.0230.02218.62
5.6.160.0100.02216.97
5.6.150.0220.00616.59
5.6.140.0160.01616.87
5.6.130.0110.01816.68
5.6.120.0100.01616.65
5.6.110.0260.00817.11
5.6.100.0160.02016.91
5.6.90.0250.01516.89
5.6.80.0130.01617.05
5.5.380.0100.01613.34
5.5.370.0180.00713.62
5.5.360.0060.02613.84
5.5.350.0090.01513.75
5.5.340.0270.00513.59
5.5.330.0120.01213.43
5.5.320.0230.01414.84
5.5.310.0120.01913.75
5.5.300.0180.00613.55
5.5.290.0140.01414.68
5.5.280.0180.01215.17
5.5.270.0160.01013.59
5.5.260.0210.01213.96
5.5.250.0150.01613.71
5.5.240.0170.01313.77
5.4.450.0070.01713.90
5.4.440.0190.01614.86
5.4.430.0130.01513.67
5.4.420.0270.00813.55
5.4.410.0120.01714.11

preferences:
44.95 ms | 401 KiB | 5 Q