3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Route { private $method, $path, $handler; public function __construct($method, $path, $handler) { $this->method = $method; $this->path = $path; $this->handler = $handler; } public function prepend($path) { $this->path = $path . $this->path; return $this; } } function route($method, $path, $handler) { return new Route($method, $path, $handler); } function group($path, $function) { foreach ($function() as $route) { yield $route->prepend($path); } } function get_routes() { $handler = 'doSomething'; yield route('GET', '/', $handler); yield route('GET', '/foo', $handler); yield from group('/bar', function () { yield route('GET', '/hello ', $handler); yield route('GET', '/world', $handler); }); } foreach (get_routes() as $route) { var_dump($route); }

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.130.0100.01218.12
8.4.120.0150.00620.68
8.4.110.0040.00618.82
8.4.100.0070.01217.83
8.4.90.0100.00920.46
8.4.80.0070.00518.81
8.4.70.0060.00318.75
8.4.60.0110.01018.82
8.4.50.0110.00924.01
8.4.40.0060.01319.70
8.4.30.0080.00417.82
8.4.20.0160.00717.71
8.4.10.0170.00317.66
8.3.260.0070.01317.01
8.3.250.0110.00819.02
8.3.240.0150.00516.80
8.3.230.0110.01016.77
8.3.220.0100.00918.97
8.3.210.0030.00518.64
8.3.200.0030.00616.64
8.3.190.0060.00517.08
8.3.180.0080.00919.27
8.3.170.0050.00318.76
8.3.160.0040.00418.94
8.3.150.0110.00717.12
8.3.140.0030.00519.01
8.3.130.0030.00618.72
8.3.120.0170.00318.79
8.3.110.0060.00320.94
8.3.100.0100.00024.06
8.3.90.0150.00326.77
8.3.80.0100.00316.63
8.3.70.0060.01018.43
8.3.60.0040.01116.63
8.3.50.0150.00422.05
8.3.40.0090.01218.84
8.3.30.0120.00318.84
8.3.20.0000.00820.29
8.3.10.0030.00520.52
8.3.00.0040.00418.80
8.2.290.0070.00316.81
8.2.280.0050.00218.70
8.2.270.0120.00616.60
8.2.260.0150.00017.00
8.2.250.0220.00016.89
8.2.240.0150.00017.26
8.2.230.0160.00022.58
8.2.220.0050.00337.54
8.2.210.0050.00326.77
8.2.200.0070.00316.63
8.2.190.0130.00616.63
8.2.180.0130.00616.88
8.2.170.0040.01522.96
8.2.160.0070.00719.32
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00819.23
8.2.120.0080.00026.35
8.2.110.0070.00421.06
8.2.100.0080.00417.91
8.2.90.0000.00817.75
8.2.80.0080.00018.77
8.2.70.0050.00317.63
8.2.60.0080.00017.63
8.2.50.0050.00518.09
8.2.40.0000.00820.55
8.2.30.0040.00419.42
8.2.20.0050.00317.78
8.2.10.0080.00018.20
8.2.00.0040.00418.14
8.1.330.0100.00916.45
8.1.320.0120.00716.17
8.1.310.0030.01419.98
8.1.300.0050.00517.94
8.1.290.0070.00330.84
8.1.280.0180.00025.92
8.1.270.0110.00723.99
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0060.00323.97
8.1.230.0090.00320.97
8.1.220.0060.00317.80
8.1.210.0080.00018.77
8.1.200.0030.00617.38
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0060.00318.59
8.1.160.0000.00720.86
8.1.150.0040.00418.91
8.1.140.0000.00719.52
8.1.130.0000.00817.72
8.1.120.0050.00317.45
8.1.110.0000.00717.48
8.1.100.0040.00417.48
8.1.90.0000.00717.45
8.1.80.0000.00817.37
8.1.70.0030.00317.52
8.1.60.0040.00417.54
8.1.50.0060.00317.58
8.1.40.0040.00417.42
8.1.30.0030.00617.63
8.1.20.0030.00617.65
8.1.10.0040.00417.56
8.1.00.0050.00317.46
8.0.300.0040.00420.04
8.0.290.0040.00416.75
8.0.280.0030.00318.39
8.0.270.0030.00517.27
8.0.260.0000.00618.52
8.0.250.0070.00017.04
8.0.240.0040.00416.91
8.0.230.0030.00417.02
8.0.220.0050.00316.87
8.0.210.0000.00717.01
8.0.200.0030.00316.93
8.0.190.0030.00316.89
8.0.180.0030.00516.97
8.0.170.0000.00816.98
8.0.160.0050.00216.99
8.0.150.0040.00416.80
8.0.140.0070.00016.93
8.0.130.0050.00013.29
8.0.120.0050.00216.85
8.0.110.0080.00016.84
8.0.100.0040.00416.91
8.0.90.0050.00216.91
8.0.80.0110.00316.97
8.0.70.0040.00416.89
8.0.60.0000.00816.91
8.0.50.0000.00717.00
8.0.30.0120.00617.15
8.0.20.0110.00917.40
8.0.10.0000.00717.20
8.0.00.0090.00916.95
7.4.330.0000.00515.08
7.4.320.0070.00016.52
7.4.300.0070.00016.43
7.4.290.0040.00416.64
7.4.280.0040.00416.59
7.4.270.0030.00316.60
7.4.260.0000.00716.61
7.4.250.0040.00416.58
7.4.240.0050.00316.67
7.4.230.0000.00716.57
7.4.220.0070.01016.56
7.4.210.0070.01116.58
7.4.200.0040.00416.65
7.4.160.0080.00816.80
7.4.150.0060.01317.40
7.4.140.0190.00617.86
7.4.130.0090.01216.49
7.4.120.0050.01416.60
7.4.110.0120.00916.48
7.4.100.0060.01216.59
7.4.90.0080.00816.50
7.4.80.0180.00019.39
7.4.70.0080.00816.57
7.4.60.0100.00616.53
7.4.50.0090.00616.64
7.4.40.0030.01516.45
7.4.30.0130.01016.37
7.4.00.0030.01115.18
7.3.330.0000.00513.41
7.3.320.0030.00313.39
7.3.310.0000.00716.40
7.3.300.0030.00316.25
7.3.290.0070.00016.34
7.3.280.0120.00916.39
7.3.270.0130.00617.40
7.3.260.0170.01416.55
7.3.250.0070.01316.44
7.3.240.0110.01116.55
7.3.230.0110.00716.54
7.3.210.0030.01316.33
7.3.200.0060.01216.56
7.3.190.0060.01116.51
7.3.180.0070.01016.26
7.3.170.0100.00716.53
7.3.160.0090.00916.44
7.2.330.0120.00616.58
7.2.320.0060.01616.72
7.2.310.0040.01416.49
7.2.300.0150.00316.91
7.2.290.0190.00616.68
7.2.60.0040.01216.98
7.2.50.0000.00917.04
7.2.00.0070.00319.42
7.1.200.0020.00515.95
7.1.100.0080.00018.23
7.1.70.0050.00317.02
7.1.60.0070.01819.19
7.1.50.0000.01216.64
7.1.00.0100.07022.32
7.0.200.0030.00616.86
7.0.60.0070.08021.77
7.0.50.0030.07317.90
7.0.40.0100.03720.22
7.0.30.0330.06320.20
7.0.20.0270.08320.23
7.0.10.0070.08720.30
7.0.00.0030.08320.06
5.6.280.0000.07721.09
5.6.210.0030.04020.72
5.6.200.0100.03718.20
5.6.190.0170.04020.61
5.6.180.0070.08020.64
5.6.170.0230.04320.57
5.6.160.0030.09320.61
5.6.150.0130.06318.21
5.6.140.0030.08318.18
5.6.130.0030.04018.19
5.6.120.0030.04321.13
5.6.110.0100.04321.13
5.6.100.0100.08721.00
5.6.90.0100.06321.13
5.6.80.0200.06320.54
5.5.350.0000.08320.40
5.5.340.0100.06317.98
5.5.330.0170.04320.31
5.5.320.0570.05020.36
5.5.310.0170.04020.32
5.5.300.0070.04018.04
5.5.290.0100.06018.08
5.5.280.0070.08320.88
5.5.270.0170.07720.66
5.5.260.0070.08320.98
5.5.250.0070.08020.63
5.5.240.0230.07720.17

preferences:
30.07 ms | 403 KiB | 5 Q