3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace App; class Container { private array $objects = []; public function __construct() { // Ключи в этом массиве - строковые ID объектов // Значения - функции, строящие нужный объект $this->objects = [ 'db' => fn() => new Db(), 'repository.user' => fn() => new UserRepository($this->get('db')), 'controller.user' => fn() => new UserController($this->get('repository.user')), ]; } public function has(string $id): bool { return isset($this->objects[$id]); } public function get(string $id): mixed { return $this->objects[$id](); } }

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.4.120.0100.00920.38
8.4.110.0140.00422.59
8.4.100.0120.00917.41
8.4.90.0120.00818.82
8.4.80.0120.00817.73
8.4.70.0090.01118.02
8.4.60.0120.01018.50
8.4.50.0110.00918.38
8.4.40.0000.01217.59
8.4.30.0060.00918.71
8.4.20.0070.00718.91
8.4.10.0070.00319.05
8.3.250.0140.00518.84
8.3.240.0120.00716.98
8.3.230.0130.00716.46
8.3.220.0110.00817.05
8.3.210.0090.01016.38
8.3.200.0060.00216.71
8.3.190.0050.00417.01
8.3.180.0120.00718.50
8.3.170.0110.00720.45
8.3.160.0070.01116.83
8.3.150.0150.00318.97
8.3.140.0050.00317.04
8.3.130.0050.00318.29
8.3.120.0060.00318.87
8.3.110.0060.00320.94
8.3.100.0090.00624.06
8.3.90.0050.00316.41
8.3.80.0070.00416.25
8.3.70.0110.00716.58
8.3.60.0160.00016.32
8.3.50.0180.00316.61
8.3.40.0100.00720.34
8.3.30.0100.00620.40
8.3.20.0040.00424.18
8.3.10.0100.01024.66
8.3.00.0100.01024.66
8.2.290.0050.00320.45
8.2.280.0080.01119.92
8.2.270.0110.00318.85
8.2.260.0140.00416.54
8.2.250.0030.00516.43
8.2.240.0090.00918.83
8.2.230.0040.00422.58
8.2.220.0060.00337.54
8.2.210.0000.00826.77
8.2.200.0080.00016.38
8.2.190.0050.01016.58
8.2.180.0060.01018.18
8.2.170.0090.00618.86
8.2.160.0040.01822.96
8.2.150.0040.00425.66
8.2.140.0130.00324.66
8.2.130.0100.01024.66
8.2.120.0110.01124.66
8.2.110.0130.00724.66
8.2.100.0090.00624.66
8.2.90.0190.00024.66
8.2.80.0090.00924.66
8.2.70.0160.00024.66
8.2.60.0170.00324.66
8.2.50.0170.00324.66
8.2.40.0170.00324.66
8.2.30.0100.01024.66
8.2.20.0030.01724.66
8.2.10.0060.01024.66
8.2.00.0140.00724.66
8.1.330.0080.01121.72
8.1.320.0070.01216.18
8.1.310.0090.00918.01
8.1.300.0050.00317.85
8.1.290.0050.00530.84
8.1.280.0170.00725.92
8.1.270.0070.01424.66
8.1.260.0120.00324.66
8.1.250.0030.01424.66
8.1.240.0000.00924.66
8.1.230.0040.00424.66
8.1.220.0140.00424.66
8.1.210.0090.00624.66
8.1.200.0090.00924.66
8.1.190.0090.00024.66
8.1.180.0000.00824.66
8.1.170.0080.00024.66
8.1.160.0040.00424.66
8.1.150.0130.00324.66
8.1.140.0120.00324.66
8.1.130.0090.00624.66
8.1.120.0040.00424.66
8.1.110.0060.00324.66
8.1.100.0030.01324.66
8.1.90.0030.00624.66
8.1.80.0060.00324.66
8.1.70.0040.00424.66
8.1.60.0040.00424.66
8.1.50.0000.00824.66
8.1.40.0040.00424.66
8.1.30.0000.00924.66
8.1.20.0100.00024.66
8.1.10.0080.00324.66
8.1.00.0060.00324.66

preferences:
28.82 ms | 403 KiB | 5 Q