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 = ini_parse_string($routerConfig, true); $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.0100.01018.56
8.3.50.0070.01122.05
8.3.40.0040.01118.66
8.3.30.0110.00419.09
8.3.20.0000.00720.38
8.3.10.0000.00820.16
8.3.00.0050.00322.43
8.2.180.0120.00316.75
8.2.170.0140.00722.96
8.2.160.0120.00920.75
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00819.36
8.2.110.0090.00019.25
8.2.100.0070.00417.83
8.2.90.0000.00917.63
8.2.80.0060.00317.97
8.2.70.0040.00417.91
8.2.60.0040.00418.09
8.2.50.0030.00618.10
8.2.40.0000.00720.61
8.2.30.0000.00819.25
8.2.20.0050.00217.67
8.2.10.0020.00519.59
8.2.00.0040.00417.73
8.1.280.0120.00625.92
8.1.270.0050.00323.91
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0120.00017.35
8.1.230.0000.01017.64
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0080.00017.23
8.1.180.0080.00018.10
8.1.170.0040.00418.46
8.1.160.0050.00322.16
8.1.150.0040.00418.50
8.1.140.0000.00817.41
8.1.130.0030.00517.80
8.1.120.0000.00717.33
8.1.110.0050.00317.43
8.1.100.0030.00617.46
8.1.90.0040.00417.36
8.1.80.0030.00317.46
8.1.70.0000.00717.37
8.1.60.0080.00317.50
8.1.50.0040.00417.43
8.1.40.0040.00417.53
8.1.30.0040.00417.61
8.1.20.0030.00517.68
8.1.10.0030.00617.57
8.1.00.0040.00417.37
8.0.300.0080.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.36
8.0.270.0000.00717.27
8.0.260.0000.00716.70
8.0.250.0030.00316.94
8.0.240.0000.00816.86
8.0.230.0030.00316.85
8.0.220.0000.00816.78
8.0.210.0030.00316.94
8.0.200.0040.00416.85
8.0.190.0030.00316.88
8.0.180.0030.00516.82
8.0.170.0050.00316.92
8.0.160.0080.00016.85
8.0.150.0030.00316.80
8.0.140.0040.00416.69
8.0.130.0000.00613.38
8.0.120.0090.00016.84
8.0.110.0040.00416.84
8.0.100.0050.00216.74
8.0.90.0040.00416.96
8.0.80.0060.00916.79
8.0.70.0040.00416.72
8.0.60.0000.00816.94
8.0.50.0000.00816.75
8.0.30.0130.00517.22
8.0.20.0080.01017.40
8.0.10.0040.00416.87
8.0.00.0120.00716.79
7.4.330.0020.00215.00
7.4.320.0070.00016.38
7.4.300.0000.00716.60
7.4.290.0000.00716.42
7.4.280.0060.00016.52
7.4.270.0070.00016.59
7.4.260.0000.00716.41
7.4.250.0000.00716.53
7.4.240.0030.00516.55
7.4.230.0030.00316.62
7.4.220.0090.00916.61
7.4.210.0030.01116.62
7.4.200.0070.00016.41
7.4.190.0060.00316.51
7.4.160.0120.00416.59
7.4.150.0060.01617.40
7.4.140.0080.01617.86
7.4.130.0050.01216.56
7.4.120.0090.00716.53
7.4.110.0090.00616.60
7.4.100.0100.00716.44
7.4.90.0100.01016.59
7.4.80.0120.00619.39
7.4.70.0030.01316.59
7.4.60.0070.01016.53
7.4.50.0000.00816.31
7.4.40.0060.00922.77
7.4.30.0060.00916.47
7.4.00.0070.00715.04
7.3.330.0030.00213.27
7.3.320.0030.00313.18
7.3.310.0000.00616.36
7.3.300.0080.00016.27
7.3.290.0040.01116.33
7.3.280.0060.01116.33
7.3.270.0070.01617.40
7.3.260.0120.01216.53
7.3.250.0130.00316.46
7.3.240.0060.01116.30
7.3.230.0080.00816.43
7.3.210.0060.01116.24
7.3.200.0120.00619.39
7.3.190.0060.01216.39
7.3.180.0110.01316.21
7.3.170.0120.00316.31
7.3.160.0030.01316.59
7.3.120.0070.01114.93
7.3.10.0070.00716.55
7.3.00.0050.00516.70
7.2.330.0160.00616.60
7.2.320.0030.01616.38
7.2.310.0100.00616.33
7.2.300.0030.01316.34
7.2.290.0080.00816.38
7.2.130.0030.01016.88
7.2.120.0090.00316.59
7.2.110.0030.00916.79
7.2.100.0070.00716.60
7.2.90.0130.00316.66
7.2.80.0070.00716.89
7.2.70.0060.00616.83
7.2.60.0100.00716.65
7.2.50.0000.01116.91
7.2.40.0070.00716.82
7.2.30.0140.00016.84
7.2.20.0030.00616.69
7.2.10.0040.01116.79
7.2.00.0030.00717.87
7.1.250.0030.00915.47
7.1.200.0070.00715.67
7.1.70.0030.00516.82
7.1.60.0060.00617.05
7.1.50.0130.01034.73
7.1.00.0070.07322.45
7.0.200.0030.01316.69
7.0.140.0000.07321.98
7.0.60.0100.08020.04
7.0.50.0070.07717.88
7.0.40.0130.07020.13
7.0.30.0430.06020.15
7.0.20.0230.03320.23
7.0.10.0200.07020.21
7.0.00.0130.08320.14
5.6.280.0070.07021.13
5.6.210.0030.07720.54
5.6.200.0070.08718.21
5.6.190.0130.08320.61
5.6.180.4200.04020.49
5.6.170.0270.04720.46
5.6.160.0100.08020.54
5.6.150.0000.04718.16
5.6.140.0070.08018.11
5.6.130.0100.08718.17
5.6.120.0100.07321.01
5.6.110.0070.06721.00
5.6.100.0070.04720.94
5.6.90.0000.04321.10
5.6.80.0070.08020.43
5.6.70.0270.03020.37
5.5.350.0130.07720.50
5.5.340.0030.06717.98
5.5.330.0000.05720.32
5.5.320.0270.07320.36
5.5.310.0370.07020.32
5.5.300.0000.04017.95
5.5.290.0070.08717.97
5.5.280.0100.03720.97
5.5.270.0000.04720.77
5.5.260.0100.04020.65
5.5.250.0170.07020.69
5.5.240.0030.06320.35
5.4.450.0670.05719.47
5.4.440.0670.05319.16
5.4.430.0130.07719.68
5.4.420.0200.04719.56
5.4.410.0230.04019.43
5.4.400.0770.00018.75
5.4.390.0970.00018.54
5.4.380.0170.06018.54
5.4.370.0330.05018.79
5.4.360.0600.05018.63
5.4.350.0400.04018.89
5.4.340.0330.05318.56
5.4.320.0080.03512.51
5.4.310.0030.04112.50
5.4.300.0060.04012.50
5.4.290.0080.04512.50
5.4.280.0030.04112.40
5.4.270.0060.04412.40
5.4.260.0100.07318.99
5.4.250.0130.06718.99
5.4.240.0100.05018.75
5.4.230.0030.05718.95
5.4.220.0030.05718.84
5.4.210.0070.06718.75
5.4.200.0100.07319.01
5.4.190.0070.05318.98
5.4.180.0000.05719.03
5.4.170.0170.05018.88
5.4.160.0170.04718.63
5.4.150.0070.05718.95
5.4.140.0030.05716.32
5.4.130.0070.07016.42
5.4.120.0100.05716.54
5.4.110.0130.06316.50
5.4.100.0070.04716.54
5.4.90.0000.05316.41
5.4.80.0000.05716.63
5.4.70.0170.06316.38
5.4.60.0030.05316.47
5.4.50.0030.06316.50
5.4.40.0100.07016.43
5.4.30.0100.05016.49
5.4.20.0100.05316.47
5.4.10.0070.05316.58
5.4.00.0130.04315.84
5.3.290.0090.03912.80
5.3.280.0030.07014.57
5.3.270.0070.08014.63
5.3.260.0070.07314.61
5.3.250.0130.04314.58
5.3.240.0130.05014.70
5.3.230.0070.05314.51
5.3.220.0030.05714.67
5.3.210.0130.06714.64
5.3.200.0100.05014.40
5.3.190.0100.04714.57
5.3.180.0030.05314.65
5.3.170.0070.05314.70
5.3.160.0100.07014.61
5.3.150.0070.06314.55
5.3.140.0130.07314.64
5.3.130.0070.07714.55
5.3.120.0070.08014.57
5.3.110.0030.05714.77
5.3.100.0070.07314.02
5.3.90.0100.04713.85
5.3.80.0100.04714.20
5.3.70.0070.07314.06
5.3.60.0030.05313.84
5.3.50.0170.04714.04
5.3.40.0070.05014.03
5.3.30.0130.04714.01
5.3.20.0030.05013.77
5.3.10.0070.06313.56
5.3.00.0070.04713.71
5.2.170.0030.04310.98
5.2.160.0100.04311.15
5.2.150.0170.03711.05
5.2.140.0000.04711.21
5.2.130.0070.04011.11
5.2.120.0030.04710.94
5.2.110.0070.03711.33
5.2.100.0100.04711.01
5.2.90.0000.04311.01
5.2.80.0000.04011.08
5.2.70.0030.04010.93
5.2.60.0100.03711.05
5.2.50.0100.04011.11
5.2.40.0030.05011.18
5.2.30.0100.05010.93
5.2.20.0070.04311.18
5.2.10.0100.03710.77
5.2.00.0200.02710.79
5.1.60.0030.03710.07
5.1.50.0100.03010.09
5.1.40.0200.0339.91
5.1.30.0070.04010.31
5.1.20.0000.05010.54
5.1.10.0070.03710.12
5.1.00.0100.03010.13
5.0.50.0030.0308.48
5.0.40.0070.0308.47
5.0.30.0070.0378.43
5.0.20.0130.0208.44
5.0.10.0030.0278.18
5.0.00.0000.0478.21
4.4.90.0000.0235.87
4.4.80.0130.0135.87
4.4.70.0030.0275.87
4.4.60.0000.0235.87
4.4.50.0070.0205.87
4.4.40.0070.0305.87
4.4.30.0030.0235.87
4.4.20.0070.0275.91
4.4.10.0030.0205.89
4.4.00.0030.0475.87
4.3.110.0030.0205.87
4.3.100.0070.0175.87
4.3.90.0000.0205.88
4.3.80.0070.0305.87
4.3.70.0070.0175.87
4.3.60.0000.0205.87
4.3.50.0030.0205.87
4.3.40.0000.0375.87
4.3.30.0030.0305.87
4.3.20.0000.0235.87
4.3.10.0000.0275.87
4.3.00.0030.0237.32

preferences:
42.85 ms | 401 KiB | 5 Q