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 static; } 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)
7.0.00.0130.07320.32
5.6.160.0130.07720.54
5.6.150.0000.05018.17
5.6.140.0030.04018.28
5.6.130.0100.05018.19
5.6.120.0070.04321.01
5.6.110.0100.07021.00
5.6.100.0200.05321.02
5.6.90.0100.03321.05
5.6.80.0100.08020.44
5.5.300.0070.06018.00
5.5.290.0200.06717.98
5.5.280.0100.08720.86
5.5.270.0030.04320.91
5.5.260.0100.07320.71
5.5.250.0030.09020.70
5.5.240.0270.06720.18

preferences:
138.09 ms | 1394 KiB | 7 Q