3v4l.org

run code in 300+ PHP versions simultaneously
<?php $__CLASSES = []; $__CLASSES["Foo"] = [ "vars" => ["bar" => null], "methods" => [ "__construct" => function(&$this_, $bar) { $this_["vars"]["bar"] = $bar; }, "bar" => function(&$this_) { return $this_["methods"]["foo"]($this_); }, "foo" => function(&$this_) { static $bar; if (!$bar) { $bar = $this_["vars"]["bar"]; } return $bar; } ] ]; function __new($class, ...$args) { global $__CLASSES; $object = $__CLASSES[$class]; if (isset($object["methods"]["__construct"])) { $object["methods"]["__construct"]($object, ...$args); } return $object; } var_dump(($__temp = __new("Foo", 123))["methods"]["bar"]($__temp)); var_dump(($__temp = __new("Foo", 456))["methods"]["bar"]($__temp));

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.0100.00718.43
8.3.50.0030.01018.21
8.3.40.0090.00618.84
8.3.30.0070.00718.70
8.3.20.0000.00821.86
8.3.10.0060.00321.89
8.3.00.0000.00820.93
8.2.180.0140.00716.47
8.2.170.0110.00422.96
8.2.160.0090.00620.39
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00422.30
8.2.120.0040.00426.35
8.2.110.0100.00020.99
8.2.100.0110.00018.03
8.2.90.0040.00420.61
8.2.80.0080.00020.36
8.2.70.0000.00817.80
8.2.60.0080.00417.80
8.2.50.0000.00818.10
8.2.40.0000.00820.48
8.2.30.0050.00220.36
8.2.20.0040.00418.07
8.2.10.0000.00718.04
8.2.00.0020.00518.30
8.1.280.0070.01425.92
8.1.270.0070.00023.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0050.00522.13
8.1.230.0090.00320.91
8.1.220.0040.00417.76
8.1.210.0040.00418.97
8.1.200.0060.00317.35
8.1.190.0090.00317.25
8.1.180.0040.00418.10
8.1.170.0080.00018.55
8.1.160.0050.00219.04
8.1.150.0050.00220.25
8.1.140.0030.00619.61
8.1.130.0040.00419.04
8.1.120.0060.00317.52
8.1.110.0000.00817.52
8.1.100.0040.00317.52
8.1.90.0000.00717.35
8.1.80.0070.00017.54
8.1.70.0000.00717.46
8.1.60.0070.00017.62
8.1.50.0040.00417.52
8.1.40.0050.00317.57
8.1.30.0000.00817.76
8.1.20.0040.00417.70
8.1.10.0030.00617.59
8.1.00.0080.00017.51
8.0.300.0040.00420.18
8.0.290.0070.00016.75
8.0.280.0000.00718.48
8.0.270.0030.00517.29
8.0.260.0000.00717.20
8.0.250.0000.00717.02
8.0.240.0030.00616.86
8.0.230.0050.00216.98
8.0.220.0000.00816.82
8.0.210.0000.00717.00
8.0.200.0030.00516.90
8.0.190.0030.00617.05
8.0.180.0040.00416.94
8.0.170.0030.00917.01
8.0.160.0060.00316.91
8.0.150.0070.00016.79
8.0.140.0070.00016.85
8.0.130.0000.00613.32
8.0.120.0000.00816.90
8.0.110.0000.00816.80
8.0.100.0000.00716.92
8.0.90.0040.00416.89
8.0.80.0100.00716.82
8.0.70.0080.00017.00
8.0.60.0080.00016.98
8.0.50.0000.00716.94
8.0.30.0120.00517.00
8.0.20.0140.00717.42
8.0.10.0070.00016.86
8.0.00.0060.01216.82
7.4.330.0050.00015.55
7.4.320.0000.00616.68
7.4.300.0000.00616.62
7.4.290.0100.00016.63
7.4.280.0040.00416.53
7.4.270.0000.00716.61
7.4.260.0000.00716.62
7.4.250.0030.00416.63
7.4.240.0000.00816.63
7.4.230.0000.00716.67
7.4.220.0030.00316.68
7.4.210.0080.01116.57
7.4.200.0000.00716.66
7.4.160.0080.00816.53
7.4.150.0130.00517.40
7.4.140.0140.00617.86
7.4.130.0120.00616.58
7.4.120.0090.01516.58
7.4.110.0090.00916.52
7.4.100.0080.01116.54
7.4.90.0060.01516.61
7.4.80.0090.00919.39
7.4.70.0150.00316.66
7.4.60.0030.01316.31
7.4.50.0030.01016.49
7.4.40.0120.00616.41
7.4.30.0100.00616.73
7.4.00.0040.01115.11
7.3.330.0020.00213.43
7.3.320.0000.00513.26
7.3.310.0000.00716.34
7.3.300.0070.00016.45
7.3.290.0070.00016.36
7.3.280.0090.00916.39
7.3.270.0090.00917.40
7.3.260.0130.00716.49
7.3.250.0080.00916.47
7.3.240.0120.00616.48
7.3.230.0030.01616.46
7.3.210.0100.00716.37
7.3.200.0200.00016.43
7.3.190.0140.00416.68
7.3.180.0160.00616.43
7.3.170.0140.00716.34
7.3.160.0080.00816.36
7.3.10.0090.00916.55
7.3.00.0090.00516.72
7.2.330.0030.01316.39
7.2.320.0100.00716.47
7.2.310.0040.01216.81
7.2.300.0040.01416.75
7.2.290.0120.01316.81
7.2.130.0050.01116.95
7.2.120.0080.00516.66
7.2.110.0030.01216.90
7.2.100.0050.00916.85
7.2.90.0080.00616.67
7.2.80.0040.01016.72
7.2.70.0060.00716.89
7.2.60.0110.00616.98
7.2.50.0030.00816.89
7.2.40.0050.01017.01
7.2.30.0050.00916.95
7.2.20.0070.00416.83
7.2.10.0060.00816.96
7.2.00.0060.00817.70
7.1.250.0020.01015.67
7.1.200.0080.00015.55
7.1.100.0000.01218.32
7.1.70.0080.00016.89
7.1.60.0040.00717.18
7.1.50.0230.00716.63
7.1.20.0300.05040.32
7.1.10.0100.06022.06
7.1.00.0170.06022.35
7.0.200.0040.01416.82
7.0.160.0100.05321.88
7.0.150.0130.06021.88
7.0.140.0000.06321.99
7.0.130.0000.06321.91
7.0.120.0070.06321.91
7.0.110.0070.05721.88
7.0.100.0070.07721.90
7.0.90.0170.07321.93
7.0.80.0200.05321.92
7.0.70.0100.06321.88
7.0.60.0100.07021.74
7.0.50.0070.05722.05
7.0.40.0070.05721.77
7.0.30.0130.04721.89
7.0.20.0070.05721.86
7.0.10.0100.05021.87
7.0.00.0070.05321.92

preferences:
57.41 ms | 401 KiB | 5 Q