3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calledURL(array $urls) { /** Changes array keys to its values and vice versa. */ { $tmp = array(); foreach ($urls as $key => $value) { $tmp[ trim($value, '/') ] = $key; } $urls = $tmp; } $url = parse_url($_SERVER["REQUEST_URI"])[ 'path' ]; $url = preg_match('~/([^/]+)/?$~', $url, $matches) ? $matches[ 1 ] : false; // also trim($s, '/') included if(! $url) { return -1; } return $urls[ $url ]; } echo calledURL([ 'receive', 'parse' ]); var_dump($_SERVER);

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.40.0090.00619.04
8.3.30.0100.00319.12
8.3.20.0040.00420.29
8.3.10.0070.00023.48
8.3.00.0030.00517.88
8.2.170.0120.00922.96
8.2.160.0110.00420.53
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00021.21
8.2.110.0040.00721.06
8.2.100.0120.00018.16
8.2.90.0040.00419.21
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0000.00817.91
8.2.50.0060.00318.07
8.2.40.0000.00918.28
8.2.30.0040.00418.23
8.2.20.0040.00417.96
8.2.10.0080.00018.12
8.2.00.0060.00317.92
8.1.270.0060.00323.86
8.1.260.0090.00026.35
8.1.250.0090.00028.09
8.1.240.0060.00319.39
8.1.230.0090.00319.15
8.1.220.0040.00417.80
8.1.210.0040.00418.77
8.1.200.0060.00317.48
8.1.190.0030.00517.35
8.1.180.0050.00318.10
8.1.170.0050.00318.71
8.1.160.0050.00322.02
8.1.150.0040.00418.98
8.1.140.0050.00217.62
8.1.130.0000.00717.78
8.1.120.0050.00217.68
8.1.110.0040.00417.66
8.1.100.0000.00717.66
8.1.90.0050.00217.68
8.1.80.0000.00717.62
8.1.70.0070.00017.58
8.1.60.0060.00317.66
8.1.50.0000.00917.71
8.1.40.0030.00517.71
8.1.30.0000.00817.80
8.1.20.0070.00417.77
8.1.10.0000.00717.76
8.1.00.0080.00017.55
8.0.300.0000.00818.77
8.0.290.0040.00416.88
8.0.280.0080.00018.54
8.0.270.0040.00417.34
8.0.260.0060.00017.23
8.0.250.0040.00417.08
8.0.240.0000.00917.07
8.0.230.0030.00317.06
8.0.220.0030.00317.13
8.0.210.0000.00817.07
8.0.200.0060.00017.11
8.0.190.0070.00017.14
8.0.180.0080.00017.12
8.0.170.0000.00717.13
8.0.160.0030.00317.04
8.0.150.0030.00516.96
8.0.140.0040.00417.05
8.0.130.0090.00013.57
8.0.120.0000.00916.97
8.0.110.0050.00317.01
8.0.100.0040.00417.13
8.0.90.0000.00816.99
8.0.80.0190.00617.11
8.0.70.0000.00817.08
8.0.60.0000.01017.11
8.0.50.0040.00417.11
8.0.30.0100.01017.47
8.0.20.0140.00717.40
8.0.10.0000.00717.29
8.0.00.0100.01216.77
7.4.330.0000.00715.15
7.4.320.0000.00716.73
7.4.300.0060.00016.74
7.4.290.0000.00716.77
7.4.280.0000.00716.76
7.4.270.0070.00016.88
7.4.260.0080.00016.82
7.4.250.0000.00716.80
7.4.240.0030.00416.77
7.4.230.0040.00416.57
7.4.220.0070.01116.75
7.4.210.0030.01116.80
7.4.200.0040.00416.73
7.4.160.0070.01016.74
7.4.150.0120.00817.40
7.4.140.0110.00817.86
7.4.130.0140.00416.86
7.4.120.0120.00516.74
7.4.110.0160.00616.67
7.4.100.0130.00616.51
7.4.90.0060.01216.87
7.4.80.0130.00616.68
7.4.70.0110.00816.87
7.4.60.0100.01016.55
7.4.50.0070.01116.49
7.4.40.0060.01316.60
7.4.30.0160.00616.54
7.4.20.0130.01016.66
7.4.10.0080.01215.90
7.4.00.0050.01115.74
7.3.330.0050.00013.53
7.3.320.0050.00013.58
7.3.310.0030.00316.58
7.3.300.0050.00216.54
7.3.290.0060.00916.59
7.3.280.0130.00516.62
7.3.270.0190.00617.40
7.3.260.0040.01816.60
7.3.250.0110.00816.71
7.3.240.0120.00616.61
7.3.230.0070.01116.49
7.3.210.0120.00616.89
7.3.200.0120.01119.39
7.3.190.0110.01516.58
7.3.180.0140.00716.62
7.3.170.0230.00616.42
7.3.160.0100.01116.49
7.3.150.0040.01616.77
7.3.140.0080.01316.48
7.3.130.0060.01515.72
7.3.120.0070.01015.97
7.3.110.0090.01315.71
7.3.100.0090.00815.84
7.3.90.0030.01215.89
7.3.80.0070.00815.71
7.3.70.0090.01415.80
7.3.60.0110.00715.80
7.3.50.0090.01015.60
7.3.40.0050.01315.81
7.3.30.0090.00715.81
7.3.20.0110.00416.65
7.3.10.0100.00916.77
7.3.00.0140.00516.68
7.2.330.0120.01216.87
7.2.320.0170.01016.84
7.2.310.0130.00716.79
7.2.300.0100.01616.68
7.2.290.0080.01216.71
7.2.280.0100.01116.65
7.2.270.0190.02217.07
7.2.260.0080.01415.94
7.2.250.0120.00715.98
7.2.240.0100.00915.94
7.2.230.0090.00815.92
7.2.220.0140.00516.03
7.2.210.0090.01116.12
7.2.200.0120.00916.02
7.2.190.0130.00515.97
7.2.180.0100.00715.99
7.2.170.0080.01016.11
7.2.160.0080.00615.89
7.2.150.0080.01017.09
7.2.140.0090.01116.95
7.2.130.0150.00517.09
7.2.120.0110.00517.03
7.2.110.0070.01116.88
7.2.100.0110.00816.84
7.2.90.0090.01017.10
7.2.80.0120.00816.87
7.2.70.0120.00816.78
7.2.60.0030.01217.00
7.2.50.0100.00617.03
7.2.40.0090.01017.11
7.2.30.0090.00717.11
7.2.20.0100.01116.99
7.2.10.0100.00816.99
7.2.00.0050.01018.02
7.1.330.0130.00916.79
7.1.320.0200.00716.70
7.1.310.0190.00416.81
7.1.300.0260.00216.00
7.1.290.0150.00715.78
7.1.280.0110.00715.81
7.1.270.0180.00816.06
7.1.260.0130.00716.00
7.1.250.0060.01015.91
7.1.240.0100.01015.74
7.1.230.0110.01215.92
7.1.220.0100.01115.86
7.1.210.0160.00315.76
7.1.200.0120.00715.90
7.1.190.0080.01115.83
7.1.180.0120.00715.89
7.1.170.0120.01115.91
7.1.160.0100.00915.92
7.1.150.0080.01015.74
7.1.140.0120.00615.77
7.1.130.0140.00615.80
7.1.120.0110.00815.84
7.1.110.0160.00515.97
7.1.100.0120.00716.71
7.1.90.0140.00815.90
7.1.80.0100.01115.67
7.1.70.0090.00716.32
7.1.60.0120.00817.04
7.1.50.0110.01016.24
7.1.40.0120.01115.55
7.1.30.0200.00815.86
7.1.20.0120.01115.80
7.1.10.0150.00815.76
7.1.00.0090.03418.03
7.0.330.0260.00515.52
7.0.320.0140.00815.52
7.0.310.0100.00915.54
7.0.300.0100.01015.50
7.0.290.0110.00815.43
7.0.280.0190.00615.32
7.0.270.0170.00215.39
7.0.260.0240.00815.32
7.0.250.0060.01315.53
7.0.240.0150.00415.69
7.0.230.0140.00615.62
7.0.220.0120.00615.40
7.0.210.0150.00915.45
7.0.200.0130.00715.91
7.0.190.0120.00515.53
7.0.180.0130.01015.38
7.0.170.0150.00515.29
7.0.160.0190.00215.34
7.0.150.0200.00615.55
7.0.140.0060.03617.65
7.0.130.0070.01015.44
7.0.120.0130.01115.31
7.0.110.0150.00815.28
7.0.100.0110.01115.36
7.0.90.0140.00715.32
7.0.80.0060.01115.38
7.0.70.0140.00815.46
7.0.60.0120.01817.09
7.0.50.0110.02216.27
7.0.40.0120.02316.34
7.0.30.0260.02716.54
7.0.20.0170.03316.38
7.0.10.0140.02516.53
7.0.00.0130.03216.42
5.6.400.0130.00715.44
5.6.390.0140.00615.24
5.6.380.0100.00715.31
5.6.370.0050.01615.33
5.6.360.0180.00715.01
5.6.350.0110.00715.01
5.6.340.0130.00915.36
5.6.330.0120.00715.20
5.6.320.0110.01015.10
5.6.310.0110.01315.25
5.6.300.0120.01115.16
5.6.290.0150.00815.43
5.6.280.0090.02917.19
5.6.270.0150.00615.09
5.6.260.0210.01415.01
5.6.250.0110.01215.42
5.6.240.0120.01015.20
5.6.230.0050.01215.06
5.6.220.0140.00915.41
5.6.210.0100.02717.02
5.6.200.0100.02516.23
5.6.190.0110.03817.03
5.6.180.1250.02117.09
5.6.170.0130.03017.00
5.6.160.0110.03417.10
5.6.150.0110.02116.42
5.6.140.0150.01816.22
5.6.130.0070.03716.40
5.6.120.0150.01917.13
5.6.110.0080.02417.16
5.6.100.0120.03317.25
5.6.90.0110.02917.22
5.6.80.0110.02616.92
5.6.70.1640.01616.86
5.6.60.0140.00815.21
5.6.50.0110.01015.18
5.6.40.0150.00815.12
5.6.30.0160.00515.17
5.6.20.0080.01115.22
5.6.10.0100.01615.35
5.6.00.0100.00915.17
5.5.380.0080.00815.37
5.5.370.0180.00515.28
5.5.360.0150.00915.31
5.5.350.0210.02817.13
5.5.340.0090.03416.17
5.5.330.0060.02616.92
5.5.320.0190.02216.97
5.5.310.0160.03516.99
5.5.300.0140.03216.17
5.5.290.0090.03516.16
5.5.280.0130.02817.03
5.5.270.0070.03417.05
5.5.260.0130.02717.04
5.5.250.0130.02816.96
5.5.240.0150.03316.84
5.5.230.0150.00615.21
5.5.220.0130.01015.19
5.5.210.0140.00715.22
5.5.200.0150.00815.22
5.5.190.0110.00915.19
5.5.180.0100.01315.14
5.5.170.0150.00914.99
5.5.160.0140.00715.08
5.5.150.0120.00915.14
5.5.140.0130.01015.07
5.5.130.0060.01415.10
5.5.120.0180.00615.19
5.5.110.0120.00815.03
5.5.100.0080.01415.21
5.5.90.0160.00915.15
5.5.80.0150.00615.11
5.5.70.0150.00715.16
5.5.60.0100.01315.18
5.5.50.0150.01215.01
5.5.40.0150.00815.19
5.5.30.0120.01015.17
5.5.20.0160.00915.26
5.5.10.0130.01015.09
5.5.00.0130.00715.06
5.4.450.0130.01914.75
5.4.440.0130.02014.79
5.4.430.0130.01614.75
5.4.420.0100.02314.77
5.4.410.0160.01814.71
5.4.400.0200.02014.69
5.4.390.0250.01814.54
5.4.380.0220.02214.56
5.4.370.0180.02514.49
5.4.360.0240.02214.50
5.4.350.0180.02714.43
5.4.340.0210.02514.57
5.4.330.0110.00412.50
5.4.320.0090.01712.43
5.4.310.0100.01612.40
5.4.300.0080.01712.45
5.4.290.0060.01812.50
5.4.280.0080.01612.44
5.4.270.0100.01912.36
5.4.260.0080.01912.40
5.4.250.0070.02112.35
5.4.240.0060.02012.44
5.4.230.0090.01712.35
5.4.220.0110.01312.46
5.4.210.0120.01512.43
5.4.200.0080.01912.38
5.4.190.0130.01512.42
5.4.180.0110.01812.36
5.4.170.0100.01712.41
5.4.160.0130.01212.46
5.4.150.0110.01412.42
5.4.140.0090.01812.29
5.4.130.0080.01812.27
5.4.120.0090.01812.34
5.4.110.0110.01912.25
5.4.100.0110.01512.33
5.4.90.0080.01712.37
5.4.80.0080.01812.30
5.4.70.0130.01412.29
5.4.60.0090.01612.25
5.4.50.0080.01812.30
5.4.40.0080.01512.28
5.4.30.0100.01612.25
5.4.20.0050.02012.24
5.4.10.0050.02412.26
5.4.00.0070.01712.01
5.3.290.0110.02412.91
5.3.280.0100.02412.75
5.3.270.0130.02512.86
5.3.260.0160.02512.72
5.3.250.0100.02912.71
5.3.240.0110.02712.73
5.3.230.0090.02612.75
5.3.220.0150.02112.82
5.3.210.0170.01912.76
5.3.200.0120.02212.76
5.3.190.0120.02312.77
5.3.180.0130.01912.83
5.3.170.0080.02412.82
5.3.160.0140.02112.76
5.3.150.0030.02612.85
5.3.140.0080.02512.72
5.3.130.0080.02512.72
5.3.120.0070.02412.78
5.3.110.0090.02312.71
5.3.100.0070.02312.46
5.3.90.0100.02012.47
5.3.80.0080.02212.50
5.3.70.0080.02112.40
5.3.60.0050.02512.44
5.3.50.0090.02212.38
5.3.40.0080.02312.38
5.3.30.0080.02412.37
5.3.20.0040.02612.26
5.3.10.0080.02312.11
5.3.00.0050.02612.14
5.2.170.0080.01910.51
5.2.160.0070.01910.50
5.2.150.0080.01810.58
5.2.140.0050.02210.47
5.2.130.0060.02010.45
5.2.120.0070.01810.52
5.2.110.0080.01810.47
5.2.100.0040.02210.53
5.2.90.0040.02010.45
5.2.80.0060.01910.48
5.2.70.0070.01910.40
5.2.60.0100.01710.42
5.2.50.0060.01910.48
5.2.40.0060.01910.48
5.2.30.0030.02410.34
5.2.20.0090.01810.26
5.2.10.0040.02210.23
5.2.00.0080.01710.09
5.1.60.0070.0149.44
5.1.50.0050.0169.43
5.1.40.0070.0179.49
5.1.30.0070.0169.69
5.1.20.0070.0179.64
5.1.10.0090.0149.49
5.1.00.0090.0159.40
5.0.50.0060.0148.42
5.0.40.0050.0128.35
5.0.30.0070.0188.26
5.0.20.0040.0148.24
5.0.10.0060.0148.23
5.0.00.0080.0208.22
4.4.90.0030.0127.49
4.4.80.0060.0087.48
4.4.70.0030.0127.48
4.4.60.0030.0107.48
4.4.50.0070.0067.49
4.4.40.0020.0157.46
4.4.30.0040.0087.48
4.4.20.0030.0107.53
4.4.10.0040.0107.53
4.4.00.0030.0147.48
4.3.110.0040.0097.44
4.3.100.0030.0097.43
4.3.90.0050.0087.42
4.3.80.0040.0147.39
4.3.70.0040.0087.42
4.3.60.0060.0077.41
4.3.50.0020.0117.41
4.3.40.0040.0137.37
4.3.30.0030.0096.75
4.3.20.0020.0136.74
4.3.10.0000.0126.72
4.3.00.0050.00813.08

preferences:
49.9 ms | 400 KiB | 5 Q