3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyService { function preprocess(array &$variables): void { $variables['x'] = 'X'; } } class Drupal { static function service($id): object { return new MyService(); } } class ServiceCallback { static function __callStatic(string $f, array $args) { ['service' => $service_id, 'method' => $method] = unserialize($f); $service = \Drupal::service($service_id); $service->$method(...$args); } } $variables = []; $callback = ['ServiceCallback', serialize(['service' => 'myservice', 'method' => 'preprocess'])]; call_user_func_array($callback, [&$variables]); var_export($variables);

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.120.0090.00618.75
8.3.110.0030.00520.94
8.3.100.0080.00824.06
8.3.90.0040.00426.77
8.3.80.0100.00317.97
8.3.70.0040.01116.63
8.3.60.0120.00316.46
8.3.50.0140.00416.47
8.3.40.0360.00817.24
8.3.30.0310.00917.50
8.3.20.0390.00917.37
8.3.10.0380.00617.38
8.3.00.0350.01217.46
8.2.240.0100.01019.01
8.2.230.0080.01122.58
8.2.220.0100.00037.54
8.2.210.0060.01326.77
8.2.200.0030.00616.50
8.2.190.0090.00616.58
8.2.180.0090.00916.63
8.2.170.0370.01117.75
8.2.160.0440.00617.50
8.2.150.0440.00717.50
8.2.140.0390.00717.50
8.2.130.0410.00817.25
8.2.120.0340.01217.25
8.2.110.0320.00917.38
8.2.100.0310.00917.50
8.2.90.0460.00417.63
8.2.80.0400.00617.48
8.2.70.0350.00717.25
8.2.60.0250.01117.25
8.2.50.0240.00817.50
8.2.40.0320.00417.62
8.2.30.0430.00017.50
8.2.20.0310.01417.13
8.2.10.0300.01517.38
8.2.00.0450.00317.46
8.1.290.0030.00630.84
8.1.280.0000.01525.92
8.1.270.0400.01117.36
8.1.260.0450.01716.98
8.1.250.0420.01016.74
8.1.240.0440.01216.98
8.1.230.0440.00317.23
8.1.220.0390.00717.25
8.1.210.0360.00317.11
8.1.200.0410.00417.23
8.1.190.0250.01817.23
8.1.180.0330.01017.13
8.1.170.0270.01017.00
8.1.160.0270.01617.09
8.1.150.0300.01816.88
8.1.140.0360.01216.86
8.1.130.0330.00716.99
8.1.120.0330.01017.34
8.1.110.0250.01417.13
8.1.100.0310.01217.00
8.1.90.0360.00617.35
8.1.80.0290.01017.35
8.1.70.0390.00417.22
8.1.60.0310.00817.35
8.1.50.0420.00417.34
8.1.40.0330.01317.47
8.1.30.0400.00617.25
8.1.20.0360.01017.47
8.1.10.0350.01117.25
8.1.00.0520.00616.97

preferences:
29.56 ms | 403 KiB | 5 Q