3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Configure here: $userSpecifiedPath = '/'; // ================================================================ // Don't edit below // ================================================================ $routerConfig = <<<CONFIG [/] "Controller" = "HomepageController" [404] "Controller" = "404Controller" CONFIG; class Router { private $routes; public function __construct($routes) { $this->routes = $routes; } public function getControllerFromPath($path) { if(array_key_exists($path, $this->routes) === true) { return $this->routes[$path]; } elseif(array_key_exists('404', $this->routes) === true) { return $this->routes['404']; } } } $routes = parse_ini_string($routerConfig, true); print_r($routes); $Router = new Router($routes); echo 'Using controller: ' . $Router->getControllerFromPath($userSpecifiedPath);

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.0040.01118.81
8.3.50.0100.00722.11
8.3.40.0140.00018.83
8.3.30.0120.00318.93
8.3.20.0080.00020.47
8.3.10.0070.00022.27
8.3.00.0040.00422.46
8.2.180.0090.00616.47
8.2.170.0120.00622.96
8.2.160.0110.00720.79
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0080.00019.23
8.2.110.0040.00422.24
8.2.100.0130.00019.63
8.2.90.0080.00019.23
8.2.80.0050.00318.04
8.2.70.0040.00417.75
8.2.60.0080.00017.93
8.2.50.0040.00418.07
8.2.40.0040.00420.07
8.2.30.0020.00518.13
8.2.20.0080.00017.85
8.2.10.0050.00217.76
8.2.00.0000.00717.64
8.1.280.0110.00425.92
8.1.270.0000.00821.95
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0030.00723.82
8.1.230.0080.00419.15
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0090.00017.13
8.1.190.0080.00017.28
8.1.180.0040.00418.75
8.1.170.0080.00018.64
8.1.160.0000.00821.96
8.1.150.0000.00718.50
8.1.140.0040.00417.46
8.1.130.0000.00717.76
8.1.120.0040.00317.46
8.1.110.0030.00517.30
8.1.100.0040.00417.41
8.1.90.0040.00417.48
8.1.80.0030.00517.42
8.1.70.0030.00517.46
8.1.60.0030.00717.63
8.1.50.0040.00417.48
8.1.40.0000.00817.56
8.1.30.0060.00317.68
8.1.20.0050.00317.74
8.1.10.0050.00317.61
8.1.00.0040.00417.57
8.0.300.0040.00418.77
8.0.290.0050.00317.16
8.0.280.0040.00418.31
8.0.270.0000.00817.13
8.0.260.0030.00316.75
8.0.250.0000.00717.01
8.0.240.0030.00617.00
8.0.230.0000.00716.94
8.0.220.0070.00016.91
8.0.210.0040.00416.93
8.0.200.0070.00016.86
8.0.190.0040.00417.04
8.0.180.0000.00716.96
8.0.170.0040.00416.93
8.0.160.0070.00016.73
8.0.150.0000.00716.89
8.0.140.0040.00416.89
8.0.130.0000.00613.46
8.0.120.0040.00416.85
8.0.110.0040.00416.96
8.0.100.0030.00416.85
8.0.90.0000.00816.87
8.0.80.0060.00916.91
8.0.70.0070.00017.04
8.0.60.0000.00716.76
8.0.50.0040.00416.81
8.0.30.0080.01217.11
8.0.20.0110.00617.41
8.0.10.0000.00716.98
8.0.00.0080.01016.79
7.4.330.0050.00015.00
7.4.320.0040.00416.70
7.4.300.0030.00316.48
7.4.290.0070.00016.52
7.4.280.0030.00316.56
7.4.270.0000.00716.44
7.4.260.0000.00716.60
7.4.250.0070.00016.47
7.4.240.0040.00416.59
7.4.230.0030.00316.70
7.4.220.0100.01316.61
7.4.210.0090.00816.73
7.4.200.0030.00316.75
7.4.190.0000.00716.64
7.4.160.0030.01216.38
7.4.150.0060.01217.40
7.4.140.0100.01117.86
7.4.130.0120.00516.74
7.4.120.0110.00616.43
7.4.110.0060.01016.61
7.4.100.0140.00316.45
7.4.90.0090.01016.59
7.4.80.0040.01319.39
7.4.70.0070.01016.74
7.4.60.0060.00916.65
7.4.50.0000.00816.55
7.4.40.0060.01222.77
7.4.30.0090.00716.59
7.4.00.0080.00614.82
7.3.330.0060.00013.30
7.3.320.0030.00313.38
7.3.310.0030.00316.28
7.3.300.0070.00016.37
7.3.290.0130.00716.39
7.3.280.0080.00916.36
7.3.270.0060.01017.40
7.3.260.0060.01216.32
7.3.250.0100.00716.37
7.3.240.0160.00616.42
7.3.230.0100.00716.47
7.3.210.0000.01716.29
7.3.200.0030.01319.39
7.3.190.0120.00916.27
7.3.180.0090.00916.49
7.3.170.0090.00616.39
7.3.160.0110.00816.51
7.3.120.0060.01215.02
7.3.10.0110.00716.32
7.3.00.0100.01016.39
7.2.330.0150.00616.80
7.2.320.0060.00916.76
7.2.310.0160.00616.62
7.2.300.0100.00716.70
7.2.290.0100.00716.76
7.2.130.0130.00616.26
7.2.120.0180.00016.56
7.2.110.0070.01416.64
7.2.100.0150.00016.62
7.2.90.0070.00416.86
7.2.80.0090.00316.57
7.2.70.0070.01016.79
7.2.60.0070.01016.88
7.2.50.0100.00316.84
7.2.40.0070.00716.83
7.2.30.0000.01616.66
7.2.20.0040.02117.00
7.2.10.0140.00717.06
7.2.00.0130.00718.04
7.1.250.0040.01115.68
7.1.100.0000.01118.25
7.1.70.0000.00817.24
7.1.60.0130.01019.82
7.1.50.0070.01517.12
7.1.00.0070.07022.31
7.0.200.0030.00516.73
7.0.140.0070.07322.15
7.0.60.0100.05719.93
7.0.50.0070.07717.89
7.0.40.0030.08020.05
7.0.30.0230.05720.13
7.0.20.0230.05020.16
7.0.10.0100.08720.30
7.0.00.0130.08020.31
5.6.280.0100.06320.93
5.6.210.0170.06020.61
5.6.200.0030.07018.19
5.6.190.0170.07720.77
5.6.180.3330.04020.62
5.6.170.0200.04020.50
5.6.160.0070.04020.46
5.6.150.0070.04018.19
5.6.140.0030.08718.19
5.6.130.0130.05318.15
5.6.120.0130.08020.99
5.6.110.0100.07321.02
5.6.100.0070.06321.00
5.6.90.0100.04720.95
5.6.80.0030.05320.52
5.6.70.4500.03720.28
5.5.350.2530.03720.43
5.5.340.0030.08317.95
5.5.330.0030.09020.21
5.5.320.3630.04320.38
5.5.310.0130.04320.25
5.5.300.0070.05017.95
5.5.290.0130.08017.94
5.5.280.0170.07020.77
5.5.270.0070.08320.75
5.5.260.0070.04320.77
5.5.250.0000.09020.70
5.5.240.0230.07720.13
5.4.450.0570.05719.63
5.4.440.0470.06719.61
5.4.430.0170.05019.56
5.4.420.0130.05319.54
5.4.410.0100.05719.42
5.4.400.0870.00018.84
5.4.390.0870.00018.73
5.4.380.0330.05718.80
5.4.370.0270.05018.50
5.4.360.0300.05318.77
5.4.350.0430.04318.50
5.4.340.0370.04018.51
5.4.320.0050.03912.51
5.4.310.0050.04012.50
5.4.300.0080.03712.50
5.4.290.0040.04112.50
5.4.280.0030.03812.40
5.4.270.0070.03712.39
5.4.260.0100.05018.89
5.4.250.0100.05718.95
5.4.240.0070.05718.95
5.4.230.0070.05718.92
5.4.220.0130.05718.93
5.4.210.0070.06018.89
5.4.200.0170.07018.91
5.4.190.0200.06018.78
5.4.180.0130.04718.89
5.4.170.0030.06718.82
5.4.160.0000.05718.81
5.4.150.0070.09019.00
5.4.140.0170.05316.41
5.4.130.0070.07716.43
5.4.120.0070.05716.41
5.4.110.0070.05716.40
5.4.100.0070.05016.40
5.4.90.0070.05016.38
5.4.80.0130.06016.51
5.4.70.0100.05316.69
5.4.60.0030.05716.36
5.4.50.0030.05316.45
5.4.40.0070.05016.43
5.4.30.0100.06316.45
5.4.20.0070.04716.45
5.4.10.0070.06316.32
5.4.00.0100.06715.95
5.3.290.0060.03812.80
5.3.280.0100.05014.69
5.3.270.0070.05314.52
5.3.260.0100.07014.68
5.3.250.0100.05014.70
5.3.240.0100.05014.75
5.3.230.0130.04714.69
5.3.220.0100.05014.79
5.3.210.0170.05014.66
5.3.200.0100.06714.66
5.3.190.0130.05314.66
5.3.180.0200.04714.56
5.3.170.0030.06014.66
5.3.160.0130.07014.70
5.3.150.0070.08714.47
5.3.140.0170.04014.74
5.3.130.0170.05014.53
5.3.120.0100.04714.77
5.3.110.0070.05314.47
5.3.100.0200.04014.06
5.3.90.0100.07314.00
5.3.80.0070.05014.07
5.3.70.0030.07314.11
5.3.60.0100.05014.16
5.3.50.0030.06014.18
5.3.40.0130.04313.79
5.3.30.0100.04713.98
5.3.20.0070.04713.61
5.3.10.0070.04713.73
5.3.00.0030.07713.66
5.2.170.0100.05711.32
5.2.160.0070.03711.21
5.2.150.0100.03711.23
5.2.140.0030.05011.21
5.2.130.0070.03711.20
5.2.120.0100.03311.20
5.2.110.0070.04311.17
5.2.100.0100.04011.20
5.2.90.0030.04311.18
5.2.80.0170.03711.32
5.2.70.0070.05011.10
5.2.60.0030.04311.04
5.2.50.0030.05311.20
5.2.40.0130.04710.84
5.2.30.0070.04710.95
5.2.20.0130.04011.04
5.2.10.0100.04011.05
5.2.00.0070.03710.82
5.1.60.0000.03710.00
5.1.50.0100.03710.16
5.1.40.0070.0509.98
5.1.30.0070.03710.41
5.1.20.0000.04310.58
5.1.10.0070.0379.91
5.1.00.0070.04010.05
5.0.50.0030.0278.52
5.0.40.0030.0278.39
5.0.30.0030.0438.43
5.0.20.0030.0308.27
5.0.10.0000.0378.23
5.0.00.0030.0408.36
4.4.90.0100.0207.01
4.4.80.0000.0277.01
4.4.70.0030.0237.01
4.4.60.0000.0337.01
4.4.50.0030.0307.01
4.4.40.0000.0477.01
4.4.30.0030.0207.01
4.4.20.0030.0307.00
4.4.10.0100.0177.00
4.4.00.0030.0337.00
4.3.110.0000.0277.00
4.3.100.0000.0237.00
4.3.90.0100.0277.00
4.3.80.0070.0377.00
4.3.70.0030.0277.00
4.3.60.0100.0137.00
4.3.50.0000.0237.00
4.3.40.0000.0437.00
4.3.30.0030.0237.00
4.3.20.0030.0207.00
4.3.10.0030.0207.00
4.3.00.0100.0137.32

preferences:
54.98 ms | 401 KiB | 5 Q