3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Sample URLs. In practice there'd just be one which comes from $_SERVER['REQUEST_URI'] $urls = [ 'https://example.com', 'https://example.com/', 'https://example.com/en', 'https://example.com/en/', 'https://example.com/en/something', 'https://example.com/en/something/cheese', 'https://example.com/en/something/cheese/stuff', ]; foreach($urls as $url){ $urlParts = parse_url($url); $path = $urlParts['path'] ?? '/'; $pathParts = array_values(array_filter(explode('/', $path))); $lang = $menu = $page = $key = null; echo 'Url tested: ' . $url; echo PHP_EOL; if(!$pathParts){ echo 'Home'; }else{ // I would probably write this with a switch on the count(pathParts), or do some better // parsing here maybe, but this just shows what could happen @[0 => $lang, 1 => $menu, 2 => $page, 3 => $key] = $pathParts; echo sprintf('Lang=%1$s, Menu=%2$s, Page=%3$s, Key=%4$s', $lang, $menu, $page, $key); } echo PHP_EOL, PHP_EOL; }

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.5.30.0090.00821.06
8.5.20.0070.01020.15
8.5.10.0110.00818.47
8.5.00.0120.01020.09
8.4.180.0130.00922.08
8.4.170.0130.00823.82
8.4.160.0120.01023.95
8.4.150.0080.00517.02
8.4.140.0130.00817.56
8.4.130.0110.00918.00
8.4.120.0150.00420.61
8.4.110.0070.01222.38
8.4.100.0060.00318.68
8.4.90.0140.00618.73
8.4.80.0130.00818.70
8.4.70.0100.00817.90
8.4.60.0020.00618.77
8.4.50.0130.00818.68
8.4.40.0100.01018.79
8.4.30.0060.00318.86
8.4.20.0110.01119.73
8.4.10.0060.00319.63
8.3.300.0130.00820.82
8.3.290.0120.00820.77
8.3.280.0100.01018.54
8.3.270.0090.01016.80
8.3.260.0150.00516.64
8.3.250.0060.00318.61
8.3.240.0080.01117.34
8.3.230.0100.01016.81
8.3.220.0090.00919.17
8.3.210.0050.00318.76
8.3.200.0120.00817.04
8.3.190.0140.00517.18
8.3.180.0080.00717.40
8.3.170.0130.00620.84
8.3.160.0070.01117.25
8.3.150.0090.00917.17
8.3.140.0050.00520.62
8.3.130.0040.00816.91
8.3.120.0090.00020.81
8.3.110.0050.00520.94
8.3.100.0060.00324.06
8.3.90.0030.00526.77
8.3.80.0000.01017.97
8.3.70.0070.01418.73
8.3.60.0130.00718.68
8.3.50.0150.00018.60
8.3.40.0190.01019.25
8.3.30.0210.01019.13
8.3.20.0220.00619.25
8.3.10.0300.00419.38
8.3.00.0230.00617.63
8.2.300.0100.01518.25
8.2.290.0120.00920.32
8.2.280.0050.00418.42
8.2.270.0110.00716.73
8.2.260.0060.00918.30
8.2.250.0070.00716.86
8.2.240.0030.00619.00
8.2.230.0040.00422.58
8.2.220.0170.00037.54
8.2.210.0080.00026.77
8.2.200.0060.00318.29
8.2.190.0100.00720.43
8.2.180.0130.01016.47
8.2.170.0240.01017.84
8.2.160.0240.01219.38
8.2.150.0340.00617.38
8.2.140.0370.00317.13
8.2.130.0370.00317.13
8.2.120.0310.00317.50
8.2.110.0330.01019.25
8.2.100.0220.01117.63
8.2.90.0300.00717.63
8.2.80.0310.00317.38
8.2.70.0330.00317.38
8.2.60.0280.00617.75
8.2.50.0300.00317.63
8.2.40.0260.00418.98
8.2.30.0230.01217.38
8.2.20.0120.00917.63
8.2.10.0330.00919.13
8.2.00.0200.01017.38
8.1.340.0110.00921.64
8.1.330.0120.00622.00
8.1.320.0120.00917.84
8.1.310.0000.01416.73
8.1.300.0060.00319.79
8.1.290.0090.00030.84
8.1.280.0190.00616.10
8.1.270.0140.01117.00
8.1.260.0290.00617.38
8.1.250.0300.01117.13
8.1.240.0310.00918.87
8.1.230.0200.01217.13
8.1.220.0250.01917.13
8.1.210.0280.00416.86
8.1.200.0190.01016.85
8.1.190.0190.01116.86
8.1.180.0180.01317.13
8.1.170.0270.00717.00
8.1.160.0260.00918.75
8.1.150.0280.00717.13
8.1.140.0200.01016.75
8.1.130.0290.00317.10
8.1.120.0270.00516.97
8.1.110.0280.00619.01
8.1.100.0250.00617.13
8.1.90.0320.00418.86
8.1.80.0220.00717.13
8.1.70.0280.00316.88
8.1.60.0240.01417.00
8.1.50.0280.00617.25
8.1.40.0310.00317.38
8.1.30.0190.01517.38
8.1.20.0260.00717.13
8.1.10.0320.00317.34
8.1.00.0250.00817.13

preferences:
70.42 ms | 1044 KiB | 5 Q