3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Container { protected $items; public function __construct() { $this->items = []; } public function exists($name) { return isset($this->item[$name]); } public function get($name) { if (!isset($this->item[$name])) { throw new RuntimeException('Item "' . $name . '" not found'); } return $this->item[$name]; } public function register($name, $item, $replace = false) { if (isset($this->item[$name]) and $replace === false) { throw new RuntimeException('Item "' . $name . '" already exists'); } $this->item[$name] = $item; return $this; } public function unregister($name) { if (!isset($this->item[$name])) { throw new RuntimeException('Item "' . $name . '" not found'); } unset($this->item[$name]); } } $container = new Container(); $container->register('ultimate.question', new class(42) { private $value; public function __construct($value) { $this->value = $value; } public function value() { return $this->value; } }); ; if ($container->exists('ultimate.question')) { $answer = $container->get('ultimate.question'); echo "The answer is: ", $answer->value(), "\n"; } else { echo "Come back in 7,500,000 years\n"; }

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.70.0120.00916.63
8.3.60.0110.01116.63
8.3.50.0160.00622.11
8.3.40.0090.00618.88
8.3.30.0080.01118.67
8.3.20.0090.00020.38
8.3.10.0080.00023.70
8.3.00.0080.00019.38
8.2.180.0110.01118.57
8.2.170.0120.00322.96
8.2.160.0100.00720.35
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0030.00617.38
8.2.120.0080.00026.35
8.2.110.0040.00420.52
8.2.100.0040.00818.03
8.2.90.0000.00819.17
8.2.80.0040.00717.97
8.2.70.0040.00417.50
8.2.60.0050.00318.04
8.2.50.0030.00518.07
8.2.40.0030.00619.40
8.2.30.0040.00420.42
8.2.20.0070.00017.64
8.2.10.0030.00518.01
8.2.00.0000.00718.14
8.1.280.0040.01925.92
8.1.270.0090.00023.68
8.1.260.0080.00028.09
8.1.250.0050.00228.09
8.1.240.0030.00623.84
8.1.230.0110.00017.79
8.1.220.0090.00017.78
8.1.210.0040.00418.77
8.1.200.0030.00617.25
8.1.190.0050.00317.23
8.1.180.0090.00018.10
8.1.170.0060.00318.75
8.1.160.0000.00721.99
8.1.150.0040.00418.82
8.1.140.0050.00319.64
8.1.130.0030.00317.63
8.1.120.0050.00317.54
8.1.110.0000.00717.50
8.1.100.0060.00317.48
8.1.90.0050.00217.43
8.1.80.0050.00217.52
8.1.70.0030.00317.41
8.1.60.0040.00417.61
8.1.50.0030.00517.55
8.1.40.0040.00417.55
8.1.30.0080.00317.57
8.1.20.0040.00417.60
8.1.10.0040.00417.57
8.1.00.0070.00017.57
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0000.00718.38
8.0.270.0040.00417.20
8.0.260.0030.00317.28
8.0.250.0030.00316.99
8.0.240.0000.00816.89
8.0.230.0070.00016.88
8.0.220.0040.00416.89
8.0.210.0000.00816.99
8.0.200.0040.00416.98
8.0.190.0040.00416.98
8.0.180.0000.01016.95
8.0.170.0040.00416.91
8.0.160.0040.00416.82
8.0.150.0040.00416.83
8.0.140.0040.00416.82
8.0.130.0000.00513.25
8.0.120.0040.00416.88
8.0.110.0040.00416.90
8.0.100.0040.00416.89
8.0.90.0040.00416.82
8.0.80.0110.00616.88
8.0.70.0020.00516.90
8.0.60.0080.00016.85
8.0.50.0000.00816.95
8.0.30.0090.00917.06
8.0.20.0110.00817.40
8.0.10.0050.00317.09
8.0.00.0100.00716.79
7.4.330.0050.00016.79
7.4.320.0030.00316.61
7.4.300.0030.00316.42
7.4.290.0000.00716.63
7.4.280.0000.00816.62
7.4.270.0030.00316.49
7.4.260.0030.00316.55
7.4.250.0030.00616.44
7.4.240.0000.00716.65
7.4.230.0000.00716.36
7.4.220.0060.02016.56
7.4.210.0140.00016.66
7.4.200.0000.00716.71
7.4.160.0060.00916.47
7.4.150.0090.00917.40
7.4.140.0080.01117.86
7.4.130.0130.00816.51
7.4.120.0050.01216.52
7.4.110.0100.01316.41
7.4.100.0090.00916.40
7.4.90.0150.00316.57
7.4.80.0110.00619.39
7.4.70.0060.01516.43
7.4.60.0100.00616.64
7.4.50.0110.00416.46
7.4.40.0060.01016.60
7.4.30.0110.00816.54
7.4.00.0000.01215.10
7.3.330.0030.00513.20
7.3.320.0050.00013.37
7.3.310.0000.00716.36
7.3.300.0050.00216.36
7.3.290.0050.00916.39
7.3.280.0090.00716.33
7.3.270.0140.00317.40
7.3.260.0120.00616.54
7.3.250.0110.00616.41
7.3.240.0100.00716.44
7.3.230.0040.01316.65
7.3.210.0140.00316.54
7.3.200.0060.01116.75
7.3.190.0060.01216.68
7.3.180.0100.01116.41
7.3.170.0100.00716.68
7.3.160.0100.01116.66
7.2.330.0030.01616.64
7.2.320.0160.01816.77
7.2.310.0080.00816.45
7.2.300.0070.01416.91
7.2.290.0110.01116.79
7.2.60.0100.00316.44
7.2.00.0030.00719.10
7.1.200.0080.00415.58
7.1.100.0030.00717.56
7.1.70.0070.00017.35
7.1.60.0120.01219.48
7.1.50.0000.02016.93
7.1.00.0070.07322.33
7.0.200.0230.00414.73
7.0.60.0000.04319.85
7.0.50.0000.07017.89
7.0.40.0030.04320.15
7.0.30.0200.04320.16
7.0.20.0170.05020.26
7.0.10.0130.07720.22
7.0.00.0030.05720.30
5.6.280.0000.04321.13
5.6.210.0000.04320.62
5.6.200.0030.04018.29
5.6.190.0030.06720.63
5.6.180.0330.08020.39
5.6.170.0400.06720.71
5.6.160.0170.07320.55
5.6.150.0030.08318.18
5.6.140.0200.07018.12
5.6.130.0100.08018.29
5.6.120.0070.07321.13
5.6.110.0170.07321.01
5.6.100.0070.08321.02
5.6.90.0030.05321.13
5.6.80.0100.05320.40
5.5.350.0370.07020.48
5.5.340.0070.04317.93
5.5.330.0130.08020.13
5.5.320.0000.05720.31
5.5.310.0130.04720.27
5.5.300.0070.03718.01
5.5.290.0070.03718.07
5.5.280.0030.08320.88
5.5.270.0070.07320.77
5.5.260.0070.08320.65
5.5.250.0100.06720.70
5.5.240.0070.03720.16

preferences:
31.77 ms | 401 KiB | 5 Q