3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Services { protected $services = []; public function getService($id, callback $creator) { // Нет в кэше? Берём из creator'а // Возвращаем кэш } } class Framework extends Services { protected $instance = null; public function __construct() { // Что-то } public static function getInstance() { if (is_null(static::$instance)) { throw new \Exception('Не инициализировано'); } return static::$instance; } public static function getRouter() { return static::getInstance()->getService('framework.router', function() use ($something) { return new Router($something); }); } public static function init() { static::$instance = new self(); } public function run() { // Маршрутизация => Контроллер => Выполнение Response } } class CMS extends Framework { public static function getModulesManager() { return static::getInstance()->getService('cms.modulesmanager', function() use ($a, $b, $c) { return new ModulesManager($a, $b, $c); }); } public function run() { // Маршрутизация => Встроенные контроллеры/Модули => Выполнение Response } } // based on framework Framework::init() && Framework::run(); // где-то в компоненте: var_dump(Framework::getRouter()); // based on CMS CMS::init() && CMS::run(); // где-то в модуле: var_dump(CMS::getRouter()); var_dump(CMS::getModulesManager());

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.0150.00617.13
8.3.50.0100.00716.61
8.3.40.0090.00618.85
8.3.30.0160.00018.81
8.3.20.0030.00520.16
8.3.10.0050.00323.38
8.3.00.0040.00423.42
8.2.180.0120.00618.29
8.2.170.0140.00718.99
8.2.160.0040.01322.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00419.33
8.2.120.0050.00326.35
8.2.110.0100.00019.45
8.2.100.0090.00317.86
8.2.90.0070.00318.99
8.2.80.0060.00317.97
8.2.70.0100.00017.49
8.2.60.0000.00818.04
8.2.50.0030.00618.07
8.2.40.0000.00822.32
8.2.30.0040.00420.64
8.2.20.0000.00817.68
8.2.10.0030.00518.10
8.2.00.0050.00518.15
8.1.280.0150.00325.92
8.1.270.0090.00920.29
8.1.260.0000.00828.09
8.1.250.0070.00728.09
8.1.240.0050.00521.29
8.1.230.0110.00017.42
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0040.00417.11
8.1.180.0070.00018.10
8.1.170.0060.00318.52
8.1.160.0050.00220.68
8.1.150.0030.00618.87
8.1.140.0080.00019.63
8.1.130.0000.00717.61
8.1.120.0060.00317.48
8.1.110.0050.00317.33
8.1.100.0000.00717.34
8.1.90.0000.00717.35
8.1.80.0000.00717.45
8.1.70.0040.00417.44
8.1.60.0050.00317.55
8.1.50.0090.00017.63
8.1.40.0040.00417.53
8.1.30.0040.00417.71
8.1.20.0030.00517.68
8.1.10.0030.00517.55
8.1.00.0080.00017.45
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0030.00318.31
8.0.270.0040.00417.29
8.0.260.0000.00717.18
8.0.250.0000.00616.93
8.0.240.0000.00617.00
8.0.230.0040.00416.96
8.0.220.0000.00716.91
8.0.210.0060.00316.91
8.0.200.0000.00716.97
8.0.190.0030.00617.01
8.0.180.0030.00616.99
8.0.170.0030.00517.01
8.0.160.0030.00516.97
8.0.150.0070.00016.86
8.0.140.0050.00316.86
8.0.130.0060.00013.41
8.0.120.0000.00716.80
8.0.110.0050.00216.98
8.0.100.0000.00716.95
8.0.90.0000.00716.83
8.0.80.0040.01116.99
8.0.70.0030.00517.06
8.0.60.0000.00817.00
8.0.50.0070.00016.73
8.0.30.0080.00917.05
8.0.20.0080.01017.40
8.0.10.0070.00017.03
8.0.00.0110.00716.74
7.4.330.0040.00016.85
7.4.320.0060.00016.59
7.4.300.0070.00016.55
7.4.290.0000.00716.48
7.4.280.0000.00816.63
7.4.270.0000.00716.54
7.4.260.0030.00716.61
7.4.250.0080.00016.61
7.4.240.0030.00516.57
7.4.230.0050.00216.66
7.4.220.0190.00016.58
7.4.210.0070.00716.69
7.4.200.0020.00516.40
7.4.160.0090.00616.43
7.4.150.0120.00617.40
7.4.140.0090.00917.86
7.4.130.0060.01216.63
7.4.120.0090.00816.54
7.4.110.0060.01216.63
7.4.100.0090.00916.46
7.4.90.0030.01316.50
7.4.80.0100.00719.39
7.4.70.0130.00316.66
7.4.60.0130.00716.53
7.4.50.0070.00716.55
7.4.40.0060.01016.49
7.4.30.0100.00716.65
7.4.00.0060.00815.03
7.3.330.0020.00213.48
7.3.320.0050.00013.41
7.3.310.0000.00716.30
7.3.300.0040.00416.37
7.3.290.0130.00616.37
7.3.280.0090.00916.37
7.3.270.0120.00617.40
7.3.260.0130.00416.45
7.3.250.0140.00816.41
7.3.240.0120.00916.38
7.3.230.0060.01216.51
7.3.210.0160.00416.64
7.3.200.0100.00716.49
7.3.190.0140.00316.58
7.3.180.0120.00316.54
7.3.170.0060.00916.57
7.3.160.0080.00816.46
7.3.120.0030.01414.55
7.3.110.0070.00714.61
7.3.100.0060.00914.66
7.3.90.0080.00414.95
7.3.80.0030.00714.85
7.3.70.0070.01014.71
7.3.60.0040.01114.79
7.3.50.0000.01314.70
7.3.40.0030.00614.74
7.3.30.0040.00414.68
7.3.20.0030.00616.59
7.3.10.0050.00916.55
7.3.00.0020.01016.49
7.2.330.0090.01316.68
7.2.320.0060.01516.63
7.2.310.0130.00316.31
7.2.300.0090.01216.29
7.2.290.0230.00016.75
7.2.250.0030.01415.14
7.2.240.0130.00614.95
7.2.230.0080.00815.10
7.2.220.0090.00614.68
7.2.210.0120.00315.02
7.2.200.0030.01214.75
7.2.190.0030.00614.69
7.2.180.0090.00614.99
7.2.170.0030.01114.96
7.2.130.0080.00616.89
7.2.120.0070.01016.83
7.2.110.0070.00316.90
7.2.100.0080.00716.79
7.2.90.0110.00416.57
7.2.80.0110.00416.91
7.2.70.0060.00516.92
7.2.60.0020.01016.88
7.2.50.0070.00716.79
7.2.40.0060.00616.88
7.2.30.0040.00716.82
7.2.20.0070.00716.88
7.2.10.0030.01016.87
7.2.00.0020.01118.08
7.1.330.0030.01315.38
7.1.320.0100.00715.75
7.1.310.0070.01015.58
7.1.300.0000.01215.63
7.1.290.0040.01115.50
7.1.280.0060.00315.66
7.1.270.0070.00415.65
7.1.260.0030.00815.45
7.1.250.0060.00315.72
7.1.200.0120.00315.51
7.1.100.0070.00317.96
7.1.70.0040.00417.14
7.1.60.0060.01819.52
7.1.50.0090.00916.84
7.1.00.0000.08022.41
7.0.200.0040.00416.76
7.0.60.0100.05020.06
7.0.50.0030.04317.89
7.0.40.0070.04020.02
7.0.30.0170.06720.16
7.0.20.0370.07020.17
7.0.10.0130.08020.16
7.0.00.0030.04320.25
5.6.280.0030.05720.91
5.6.210.0070.04320.64
5.6.200.0070.06718.16
5.6.190.0030.06320.48
5.6.180.0230.04020.46
5.6.170.0230.08320.62
5.6.160.0100.08720.50
5.6.150.0200.07018.22
5.6.140.0070.06718.26
5.6.130.0070.04318.18
5.6.120.0030.04020.99
5.6.110.0000.09721.00
5.6.100.0030.04021.13
5.6.90.0030.04321.15
5.6.80.0070.06320.51
5.5.350.0300.07320.52
5.5.340.0070.08317.98
5.5.330.0130.03720.23
5.5.320.0230.04020.42
5.5.310.0300.07320.28
5.5.300.0000.05017.99
5.5.290.0070.06717.96
5.5.280.0030.04720.92
5.5.270.0130.07720.81
5.5.260.0070.04720.79
5.5.250.0030.05020.70
5.5.240.0270.06320.14

preferences:
67.01 ms | 401 KiB | 5 Q