3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RenderEngine { private $blocks = []; public function block($name, $callback) { $this->blocks[$name] = $callback; } public function draw($name, array $args) { call_user_func_args($this->blocks[$name], $args); } } $t = new RenderEngine(); ?> <?php $t->block('article', function ($article): ?> <?=$article;?> <?php endfunction;); ?> <?=$t->draw('article', ['hello']);?>

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)
5.6.140.0070.08018.17
5.6.130.0170.07718.15
5.6.120.0100.05021.12
5.6.110.0100.05721.15
5.6.100.0100.03721.05
5.6.90.0030.09321.14
5.6.80.0000.04320.41
5.6.70.0330.07020.36
5.5.300.0170.06717.95
5.5.290.0130.03717.98
5.5.280.0130.03320.99
5.5.270.0170.03720.88
5.5.260.0070.03720.88
5.5.250.0000.04320.50
5.5.240.0100.07320.25
5.4.450.0270.06019.55
5.4.440.0270.06719.43
5.4.430.0530.05319.56
5.4.420.0200.05719.58
5.4.410.0100.06019.43
5.4.400.0200.04719.12
5.4.390.0330.04719.27
5.4.380.0230.07319.29
5.4.370.0270.04719.13
5.4.360.0230.04718.95
5.4.350.0200.05018.95
5.4.340.0170.05319.28
5.4.320.0230.05319.35
5.4.310.0270.04019.17
5.4.300.0170.05319.29
5.4.290.0200.05019.28
5.4.280.0070.06718.95
5.4.270.0170.05319.10
5.4.260.0230.04319.13
5.4.250.0230.04318.84
5.4.240.0200.04719.22
5.4.230.0170.05019.00
5.4.220.0200.05019.23
5.4.210.0130.05319.13
5.4.200.0100.05719.12
5.4.190.0100.05319.26
5.4.180.0330.03318.96
5.4.170.0230.04719.27
5.4.160.0070.06019.29
5.4.150.0070.06319.26
5.4.140.0230.04316.61
5.4.130.0230.04016.38
5.4.120.0200.04716.36
5.4.110.0130.05316.30
5.4.100.0200.04316.68
5.4.90.0130.05016.30
5.4.80.0270.03716.55
5.4.70.0170.04716.64
5.4.60.0100.05716.23
5.4.50.0230.07316.40
5.4.40.0300.06316.54
5.4.30.0170.04716.25
5.4.20.0170.06016.22
5.4.10.0100.06016.60
5.4.00.0130.05316.17

preferences:
145.51 ms | 1394 KiB | 7 Q