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.0200.00316.63
8.3.50.0160.00622.92
8.3.40.0110.00418.54
8.3.30.0140.00019.04
8.3.20.0040.00420.33
8.3.10.0030.00523.36
8.3.00.0050.00319.38
8.2.180.0180.00018.29
8.2.170.0090.00622.96
8.2.160.0030.01020.36
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00421.03
8.2.110.0060.00322.27
8.2.100.0060.00618.22
8.2.90.0040.00419.40
8.2.80.0040.00417.97
8.2.70.0030.00617.38
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0070.00018.16
8.2.30.0000.00817.98
8.2.20.0040.00417.66
8.2.10.0050.00317.98
8.2.00.0030.00617.85
8.1.280.0110.00725.92
8.1.270.0080.00022.14
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.89
8.1.230.0080.00319.00
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0070.00317.35
8.1.190.0000.00817.25
8.1.180.0030.00618.10
8.1.170.0050.00518.59
8.1.160.0000.00722.03
8.1.150.0040.00418.88
8.1.140.0040.00417.31
8.1.130.0030.00317.68
8.1.120.0000.00717.33
8.1.110.0070.00017.42
8.1.100.0000.00717.49
8.1.90.0030.00517.51
8.1.80.0050.00217.38
8.1.70.0030.00317.32
8.1.60.0000.00917.55
8.1.50.0040.00417.54
8.1.40.0030.00517.45
8.1.30.0040.00417.59
8.1.20.0080.00017.46
8.1.10.0040.00417.49
8.1.00.0080.00017.47
8.0.300.0070.00318.77
8.0.290.0030.00516.75
8.0.280.0040.00418.45
8.0.270.0070.00017.23
8.0.260.0000.00717.30
8.0.250.0070.00016.90
8.0.240.0040.00417.00
8.0.230.0070.00017.03
8.0.220.0070.00016.96
8.0.210.0070.00016.91
8.0.200.0030.00316.95
8.0.190.0000.00717.13
8.0.180.0030.00516.91
8.0.170.0040.00417.00
8.0.160.0000.00717.05
8.0.150.0050.00317.00
8.0.140.0020.00816.92
8.0.130.0000.00813.41
8.0.120.0040.00416.86
8.0.110.0000.00717.01
8.0.100.0000.00716.79
8.0.90.0000.00716.81
8.0.80.0120.00317.00
8.0.70.0040.00416.83
8.0.60.0030.00616.95
8.0.50.0000.00716.98
8.0.30.0100.00917.05
8.0.20.0120.00917.40
8.0.10.0030.00617.08
8.0.00.0110.00716.66
7.4.330.0030.00315.50
7.4.320.0090.00017.94
7.4.300.0030.00617.68
7.4.290.0000.00817.86
7.4.280.0030.00617.82
7.4.270.0030.00617.81
7.4.260.0030.00617.76
7.4.250.0060.00317.66
7.4.240.0030.00617.86
7.4.230.0030.00617.77
7.4.220.0150.01217.82
7.4.210.0090.01517.80
7.4.200.0090.00017.99
7.4.160.0310.00317.67
7.4.150.0510.00918.06
7.4.140.0170.01617.88
7.4.130.0170.02017.91
7.4.120.0190.01817.90
7.4.110.0220.01218.36
7.4.100.0210.01617.79
7.4.90.0170.02717.83
7.4.80.0100.01719.39
7.4.70.0140.01417.78
7.4.60.0240.00717.78
7.4.50.0000.00718.23
7.4.40.0270.00917.90
7.4.30.0130.02217.77
7.4.00.0140.01017.15
7.3.330.0040.01117.26
7.3.320.0000.01014.79
7.3.310.0060.00317.75
7.3.300.0040.00417.54
7.3.290.0130.01917.68
7.3.280.0170.01117.74
7.3.270.0240.00917.85
7.3.260.0320.02017.76
7.3.250.0310.01117.83
7.3.240.0270.02217.63
7.3.230.0180.01917.71
7.3.210.0200.01017.78
7.3.200.0140.02219.39
7.3.190.0120.01617.72
7.3.180.0190.01617.74
7.3.170.0200.00817.60
7.3.160.0290.00518.18
7.2.330.0210.01218.29
7.2.320.0120.02218.14
7.2.310.0170.02118.10
7.2.300.0130.01618.06
7.2.290.0170.01718.53
7.2.60.0150.00317.37
7.2.00.0100.00619.88
7.1.200.0070.01017.49
7.1.100.0100.00619.41
7.1.70.0040.00418.68
7.1.60.0140.01721.38
7.1.50.0160.01018.63
7.0.200.0060.00318.44

preferences:
36.8 ms | 401 KiB | 5 Q