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("/parse")[ 'path' ]; $url = preg_match('~/([^/]+)/?$~', $url, $matches) ? $matches[ 1 ] : false; // also trim($s, '/') included if(! $url) { return -1; } return $urls[ $url ]; } echo calledURL([ 'receive', 'parse' ]);

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.0110.00416.75
8.3.50.0080.00922.97
8.3.40.0070.00719.09
8.3.30.0100.00319.21
8.3.20.0040.00420.34
8.3.10.0080.00023.48
8.3.00.0090.00017.61
8.2.180.0120.00916.88
8.2.170.0060.01522.96
8.2.160.0060.00920.47
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00420.96
8.2.110.0060.00321.07
8.2.100.0080.00417.97
8.2.90.0040.00417.97
8.2.80.0000.00817.97
8.2.70.0030.00517.88
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0000.00817.92
8.2.30.0040.00418.13
8.2.20.0000.00817.79
8.2.10.0070.00018.16
8.2.00.0050.00317.77
8.1.280.0060.00925.92
8.1.270.0000.00823.63
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00422.48
8.1.230.0070.00320.99
8.1.220.0040.00417.78
8.1.210.0040.00418.94
8.1.200.0070.00317.48
8.1.190.0040.00417.48
8.1.180.0050.00318.10
8.1.170.0040.00418.73
8.1.160.0070.00022.00
8.1.150.0050.00218.91
8.1.140.0050.00317.61
8.1.130.0000.00717.87
8.1.120.0000.00717.50
8.1.110.0040.00417.53
8.1.100.0030.00417.64
8.1.90.0070.00017.67
8.1.80.0000.00817.52
8.1.70.0040.00417.56
8.1.60.0050.00517.62
8.1.50.0040.00417.66
8.1.40.0000.00917.72
8.1.30.0030.00617.79
8.1.20.0030.00617.82
8.1.10.0000.00717.77
8.1.00.0040.00417.69
8.0.300.0100.00020.09
8.0.290.0050.00316.75
8.0.280.0030.00318.48
8.0.270.0000.00617.29
8.0.260.0000.00717.34
8.0.250.0050.00217.10
8.0.240.0030.00617.13
8.0.230.0070.00017.00
8.0.220.0000.00716.92
8.0.210.0000.00717.07
8.0.200.0040.00417.15
8.0.190.0080.00016.96
8.0.180.0000.00717.13
8.0.170.0040.00417.13
8.0.160.0000.00716.98
8.0.150.0040.00417.07
8.0.140.0000.00717.00
8.0.130.0060.00213.50
8.0.120.0030.00516.90
8.0.110.0040.00416.94
8.0.100.0040.00416.95
8.0.90.0000.00817.07
8.0.80.0120.01217.00
8.0.70.0080.00017.00
8.0.60.0000.01016.93
8.0.50.0070.00016.86
8.0.30.0120.00717.14
8.0.20.0110.01217.50
8.0.10.0000.00717.19
8.0.00.0060.01216.86
7.4.330.0000.00615.00
7.4.320.0000.00716.64
7.4.300.0030.00316.83
7.4.290.0000.00716.77
7.4.280.0070.00016.80
7.4.270.0050.00316.84
7.4.260.0000.01016.79
7.4.250.0040.00416.69
7.4.240.0040.00416.85
7.4.230.0000.00716.92
7.4.220.0040.01416.77
7.4.210.0060.00916.73
7.4.200.0000.00716.63
7.4.160.0090.00616.70
7.4.150.0110.01417.40
7.4.140.0110.00817.86
7.4.130.0050.01216.84
7.4.120.0130.00516.70
7.4.110.0090.01216.63
7.4.100.0110.00616.71
7.4.90.0120.00916.62
7.4.80.0100.01019.39
7.4.70.0080.00916.75
7.4.60.0070.01116.82
7.4.50.0080.00016.43
7.4.40.0090.01216.75
7.4.30.0080.00816.64
7.4.00.0110.00715.29
7.3.330.0000.00513.50
7.3.320.0030.00313.45
7.3.310.0070.00016.40
7.3.300.0040.00416.52
7.3.290.0100.00316.52
7.3.280.0100.01016.49
7.3.270.0100.01017.40
7.3.260.0130.01016.57
7.3.250.0070.01316.62
7.3.240.0070.01016.59
7.3.230.0130.00316.43
7.3.210.0110.01116.40
7.3.200.0090.01319.39
7.3.190.0120.00616.88
7.3.180.0090.00616.51
7.3.170.0100.00716.64
7.3.160.0060.01016.54
7.3.10.0160.00016.96
7.3.00.0030.00916.73
7.2.330.0110.00817.01
7.2.320.0130.00316.84
7.2.310.0050.01416.96
7.2.300.0130.00316.82
7.2.290.0060.01016.81
7.2.130.0040.00717.29
7.2.120.0070.00317.15
7.2.110.0070.00717.10
7.2.100.0000.01017.31
7.2.90.0120.00917.38
7.2.80.0060.01216.90
7.2.70.0050.00517.09
7.2.60.0040.01217.00
7.2.50.0030.00917.25
7.2.40.0070.00717.15
7.2.30.0090.00617.37
7.2.20.0070.01117.06
7.2.10.0030.01317.20
7.2.00.0050.00918.43
7.1.250.0070.00715.96
7.1.240.0030.00615.86
7.1.230.0000.00916.11
7.1.220.0000.01215.97
7.1.210.0070.00715.98
7.1.200.0060.00615.79
7.1.190.0030.01015.82
7.1.180.0090.00615.80
7.1.170.0040.01115.98
7.1.160.0060.01015.96
7.1.150.0060.00315.94
7.1.140.0090.00615.92
7.1.130.0120.00416.16
7.1.120.0070.00715.75
7.1.110.0110.00415.95
7.1.100.0030.00717.24
7.1.90.0030.00616.13
7.1.80.0000.01316.12
7.1.70.0030.00916.73
7.1.60.0060.00517.76
7.1.50.0110.00816.75
7.1.40.0040.01215.77
7.1.30.0060.00315.88
7.1.20.0030.01016.06
7.1.10.0000.01716.03
7.1.00.0050.04219.26
7.0.330.0100.00315.30
7.0.320.0040.00415.59
7.0.310.0000.00815.44
7.0.300.0060.00615.47
7.0.290.0120.00315.50
7.0.280.0060.00615.32
7.0.270.0060.00915.71
7.0.260.0090.00415.36
7.0.250.0040.00415.61
7.0.240.0050.00515.45
7.0.230.0100.00715.36
7.0.220.0040.01115.54
7.0.210.0070.00415.36
7.0.200.0070.00416.19
7.0.190.0060.00315.56
7.0.180.0040.01215.61
7.0.170.0060.00915.51
7.0.160.0100.00315.65
7.0.150.0030.00615.66
7.0.140.0050.04018.68
7.0.130.0000.01015.41
7.0.120.0080.00815.44
7.0.110.0080.00815.62
7.0.100.0070.00715.60
7.0.90.0160.00015.70
7.0.80.0070.01015.43
7.0.70.0040.00715.72
7.0.60.0090.03917.61
7.0.50.0050.04216.61
7.0.40.0070.04117.00
7.0.30.0130.04716.83
7.0.20.0220.02016.96
7.0.10.0110.04116.81
7.0.00.0030.05116.88
5.6.380.0040.01114.15
5.6.370.0080.00614.89
5.6.360.0000.01014.75
5.6.350.0070.00714.37
5.6.340.0030.00714.74
5.6.330.0030.01414.04
5.6.320.0130.00314.13
5.6.310.0000.00814.08
5.6.300.0110.00414.42
5.6.290.0060.00314.53
5.6.280.0030.04017.70
5.6.270.0000.01514.75
5.6.260.0040.01114.34
5.6.250.0060.00914.36
5.6.240.0070.00414.46
5.6.230.0060.01314.61
5.6.220.0080.00314.24
5.6.210.0070.03317.43
5.6.200.0070.03216.41
5.6.190.0100.04217.65
5.6.180.0180.03217.54
5.6.170.0170.02217.52
5.6.160.0080.03717.65
5.6.150.0040.04416.35
5.6.140.0090.04316.44
5.6.130.0000.02616.34
5.6.120.0060.03017.83
5.6.110.0070.04117.66
5.6.100.0080.04117.75
5.6.90.0100.03017.68
5.6.80.0120.03517.33
5.6.70.0040.01114.11
5.6.60.0100.00314.13
5.6.50.0060.00314.26
5.6.40.0060.00614.37
5.6.30.0080.00314.18
5.6.20.0040.00414.39
5.6.10.0120.00314.49
5.6.00.0000.01014.49
5.5.380.0000.00611.31
5.5.370.0030.00711.29
5.5.360.0030.00911.21
5.5.350.2210.01715.83
5.5.340.0100.03614.57
5.5.330.0080.04315.79
5.5.320.0180.02515.73
5.5.310.0180.03515.88
5.5.300.0050.02314.66
5.5.290.0090.03514.72
5.5.280.0050.03116.08
5.5.270.0040.02416.18
5.5.260.0050.04516.18
5.5.250.0070.04315.96
5.5.240.0100.04115.47
5.5.230.0000.00911.23
5.5.220.0110.00411.23
5.5.210.0040.00410.88
5.5.200.0060.00311.42
5.5.190.0060.00611.15
5.5.180.0000.01111.35
5.5.170.0040.00711.11
5.5.160.0040.00811.42
5.5.150.0060.00311.38
5.5.140.0050.00011.34
5.5.130.0090.00011.25
5.5.120.0030.00711.20
5.5.110.0070.00711.36
5.5.100.0030.00311.30
5.5.90.0050.00511.33
5.5.80.0070.00411.11
5.5.70.0080.00011.23
5.5.60.0090.00311.12
5.5.50.0030.00911.14
5.5.40.0030.00311.47
5.5.30.0060.00311.21
5.5.20.0070.00411.23
5.5.10.0040.00411.36
5.5.00.0000.01111.06
5.4.450.0190.03915.28
5.4.440.0300.03915.02
5.4.430.0250.03215.28
5.4.420.0100.02515.23
5.4.410.0080.02915.29
5.4.400.0070.03015.12
5.4.390.0120.02514.99
5.4.380.0150.03814.83
5.4.370.0130.03515.00
5.4.360.0400.02814.76
5.4.350.0180.03814.93
5.4.340.0190.02814.94
5.4.330.0100.00311.19
5.4.320.0050.02111.83
5.4.310.0020.02511.79
5.4.300.0040.02311.75
5.4.290.0050.02211.69
5.4.280.0080.02011.72
5.4.270.0050.02211.81
5.4.260.0070.02111.82
5.4.250.0030.02611.81
5.4.240.0070.02211.79
5.4.230.0030.02411.79
5.4.220.0050.02011.89
5.4.210.0080.02311.73
5.4.200.0050.02411.80
5.4.190.0040.02111.75
5.4.180.0070.01911.81
5.4.170.0060.01911.74
5.4.160.0070.02211.80
5.4.150.0020.02111.87
5.4.140.0000.02511.52
5.4.130.0060.02511.59
5.4.120.0070.01811.63
5.4.110.0020.02211.67
5.4.100.0050.02211.64
5.4.90.0060.02011.52
5.4.80.0050.02311.71
5.4.70.0070.02111.63
5.4.60.0060.01911.66
5.4.50.0070.02011.50
5.4.40.0050.02011.57
5.4.30.0060.01911.59
5.4.20.0050.02111.51
5.4.10.0060.02111.58
5.4.00.0060.01911.42
5.3.290.0060.02211.59
5.3.280.0020.02411.36
5.3.270.0030.02311.49
5.3.260.0050.02111.45
5.3.250.0020.02411.43
5.3.240.0040.02811.36
5.3.230.0020.02411.33
5.3.220.0020.02411.44
5.3.210.0040.02311.47
5.3.200.0070.02111.43
5.3.190.0040.02611.50
5.3.180.0080.02411.57
5.3.170.0040.02311.57
5.3.160.0030.02211.41
5.3.150.0040.01911.57
5.3.140.0080.01911.52
5.3.130.0040.02711.39
5.3.120.0040.02311.40
5.3.110.0060.02211.39
5.3.100.0060.02111.22
5.3.90.0060.02011.29
5.3.80.0030.02411.26
5.3.70.0020.02311.26
5.3.60.0080.02011.20
5.3.50.0070.01911.15
5.3.40.0010.02411.18
5.3.30.0040.01911.13
5.3.20.0040.02211.02
5.3.10.0030.02210.92
5.3.00.0020.02310.90
5.2.170.0060.0179.29
5.2.160.0040.0189.28
5.2.150.0030.0179.25
5.2.140.0030.0179.26
5.2.130.0040.0189.23
5.2.120.0050.0159.22
5.2.110.0040.0189.25
5.2.100.0020.0209.23
5.2.90.0030.0199.23
5.2.80.0020.0189.22
5.2.70.0020.0229.22
5.2.60.0030.0199.20
5.2.50.0080.0149.19
5.2.40.0030.0189.17
5.2.30.0020.0219.16
5.2.20.0050.0169.16
5.2.10.0020.0179.11
5.2.00.0030.0179.04
5.1.60.0030.0158.68
5.1.50.0020.0158.68
5.1.40.0030.0168.67
5.1.30.0040.0158.85
5.1.20.0030.0168.86
5.1.10.0020.0168.72
5.1.00.0020.0178.72
5.0.50.0010.0137.96
5.0.40.0040.0117.88
5.0.30.0060.0157.79
5.0.20.0020.0117.78
5.0.10.0020.0137.76
5.0.00.0050.0167.76
4.4.90.0030.0097.03
4.4.80.0030.0097.01
4.4.70.0030.0077.02
4.4.60.0040.0097.02
4.4.50.0020.0107.02
4.4.40.0030.0166.99
4.4.30.0010.0117.01
4.4.20.0010.0127.06
4.4.10.0020.0097.06
4.4.00.0020.0157.02
4.3.110.0020.0106.97
4.3.100.0050.0076.97
4.3.90.0040.0076.96
4.3.80.0020.0156.93
4.3.70.0040.0086.95
4.3.60.0020.0096.95
4.3.50.0030.0106.95
4.3.40.0010.0156.91
4.3.30.0030.0096.29
4.3.20.0030.0106.28
4.3.10.0020.0106.25
4.3.00.0050.0138.35

preferences:
43.05 ms | 400 KiB | 5 Q