3v4l.org

run code in 300+ PHP versions simultaneously
<?php $image = './image/testing.jpg'; $url = 'http://testing.com/randomdir/'; $image_parts = parse_url($image); $url_parts = parse_url($url); // check to see if the image has a path of its own if (dirname($image_parts['path']) == '.') { $image_path = dirname($url_parts['path']) . DS . $image_parts['path']; } else { $image_path = $image_parts['path']; } if (empty($image_parts['host'])) { $image_location = sprintf('%s://%s/%s/%s', $url_parts['scheme'], $url_parts['host'], dirname($url_parts['path']), $image_path); } else { $image_location = $image; } var_dump($image_location);

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.0120.00318.43
8.3.50.0070.00821.96
8.3.40.0110.00318.70
8.3.30.0060.00918.95
8.3.20.0030.00520.30
8.3.10.0040.00423.56
8.3.00.0040.00420.79
8.2.180.0090.00616.38
8.2.170.0070.00722.96
8.2.160.0100.00320.34
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0040.00420.89
8.2.110.0030.00621.00
8.2.100.0080.00317.72
8.2.90.0080.00019.17
8.2.80.0070.00317.97
8.2.70.0000.00817.63
8.2.60.0060.00318.04
8.2.50.0000.00918.10
8.2.40.0040.00420.07
8.2.30.0070.00018.25
8.2.20.0070.00017.70
8.2.10.0000.00718.05
8.2.00.0040.00417.70
8.1.280.0090.00625.92
8.1.270.0040.00423.67
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00920.89
8.1.230.0120.00017.70
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0000.00817.22
8.1.190.0040.00417.22
8.1.180.0060.00318.10
8.1.170.0080.00018.43
8.1.160.0040.00421.89
8.1.150.0040.00418.51
8.1.140.0000.00817.41
8.1.130.0000.00717.88
8.1.120.0030.00317.36
8.1.110.0080.00017.30
8.1.100.0000.00717.43
8.1.90.0000.00717.52
8.1.80.0000.00817.45
8.1.70.0000.00717.41
8.1.60.0040.00417.61
8.1.50.0000.00817.51
8.1.40.0030.00517.54
8.1.30.0080.00017.65
8.1.20.0070.00317.61
8.1.10.0000.00717.52
8.1.00.0000.00817.47
8.0.300.0040.00419.89
8.0.290.0070.00016.58
8.0.280.0070.00018.26
8.0.270.0030.00317.13
8.0.260.0000.00817.11
8.0.250.0040.00416.83
8.0.240.0030.00316.78
8.0.230.0000.00716.87
8.0.220.0070.00016.84
8.0.210.0030.00316.83
8.0.200.0030.00316.86
8.0.190.0080.00016.91
8.0.180.0000.00816.81
8.0.170.0030.00616.75
8.0.160.0000.00916.76
8.0.150.0000.00716.71
8.0.140.0040.00416.80
8.0.130.0040.00413.34
8.0.120.0050.00515.02
8.0.110.0070.00314.98
8.0.100.0080.00215.00
8.0.90.0080.00215.12
8.0.80.0080.00715.05
8.0.70.0030.00715.10
8.0.60.0020.00815.03
8.0.50.0040.00615.09
8.0.30.0080.00915.75
8.0.20.0110.00816.06
8.0.10.0050.00515.17
8.0.00.0090.00815.65
7.4.330.0000.00615.00
7.4.320.0090.00016.49
7.4.300.0000.00716.52
7.4.290.0030.00316.61
7.4.280.0030.00316.49
7.4.270.0070.00016.64
7.4.260.0030.00316.59
7.4.250.0030.00314.96
7.4.240.0060.00415.47
7.4.230.0070.00314.92
7.4.220.0070.00914.99
7.4.210.0060.00915.53
7.4.200.0080.00214.79
7.4.190.0030.00715.04
7.4.180.0030.00313.34
7.4.160.0070.00514.94
7.4.150.0060.00715.32
7.4.140.0060.00816.31
7.4.130.0090.00715.33
7.4.120.0100.00515.37
7.4.110.0090.00514.80
7.4.100.0100.00714.94
7.4.90.0090.00614.71
7.4.80.0110.00516.22
7.4.70.0060.00714.79
7.4.60.0090.00514.86
7.4.50.0060.00214.78
7.4.40.0110.00514.63
7.4.30.0060.00814.87
7.4.20.0110.00013.09
7.4.10.0070.00814.79
7.4.00.0090.00614.90
7.3.330.0060.00013.16
7.3.320.0000.00513.15
7.3.310.0070.00314.67
7.3.300.0060.00314.64
7.3.290.0060.00814.66
7.3.280.0080.01015.46
7.3.270.0030.01215.20
7.3.260.0120.00314.82
7.3.250.0110.00615.41
7.3.240.0100.00614.64
7.3.230.0030.01114.78
7.3.220.0130.00012.93
7.3.210.0050.01014.85
7.3.200.0090.00814.55
7.3.190.0080.00614.66
7.3.180.0090.00514.57
7.3.170.0050.00914.79
7.3.160.0060.00714.55
7.3.150.0050.00312.96
7.3.140.0090.00012.94
7.3.130.0020.01014.68
7.3.120.0070.00614.76
7.3.110.0090.00514.69
7.3.100.0080.00514.68
7.3.90.0020.00814.79
7.3.80.0040.00914.69
7.3.70.0060.00414.78
7.3.60.0060.00414.76
7.3.50.0060.00714.74
7.3.40.0050.00514.78
7.3.30.0060.00614.69
7.3.20.0070.00416.52
7.3.10.0040.00716.42
7.3.00.0030.00916.64
7.2.340.0120.00013.08
7.2.330.0100.00514.87
7.2.320.0080.01014.83
7.2.310.0120.00314.82
7.2.300.0050.01214.71
7.2.290.0070.00914.71
7.2.280.0060.00613.13
7.2.270.0040.00813.07
7.2.260.0070.00715.01
7.2.250.0110.00614.86
7.2.240.0030.01215.01
7.2.230.0040.00814.86
7.2.220.0030.01214.92
7.2.210.0070.00714.77
7.2.200.0060.00814.85
7.2.190.0070.00714.83
7.2.180.0110.00414.79
7.2.170.0060.00714.98
7.2.160.0060.00814.90
7.2.150.0060.01016.87
7.2.140.0040.00916.59
7.2.130.0080.00816.78
7.2.120.0080.00616.84
7.2.110.0040.00916.73
7.2.100.0040.01016.61
7.2.90.0080.00616.77
7.2.80.0080.00716.69
7.2.70.0070.00616.66
7.2.60.0060.00716.54
7.2.50.0060.00916.81
7.2.40.0050.00916.87
7.2.30.0080.00816.84
7.2.20.0040.00916.75
7.2.10.0060.00916.85
7.2.00.0070.00817.44
7.1.330.0050.00815.81
7.1.320.0100.00415.81
7.1.310.0070.00715.72
7.1.300.0060.00615.74
7.1.290.0060.00815.72
7.1.280.0070.00715.70
7.1.270.0050.00815.71
7.1.260.0070.00515.73
7.1.250.0070.00515.77
7.1.240.0090.00315.65
7.1.230.0090.00615.67
7.1.220.0080.00415.73
7.1.210.0080.00615.77
7.1.200.0070.00815.80
7.1.190.0080.00515.81
7.1.180.0090.00315.83
7.1.170.0090.00215.76
7.1.160.0060.01015.63
7.1.150.0110.00515.67
7.1.140.0080.00515.74
7.1.130.0060.00715.78
7.1.120.0060.00815.66
7.1.110.0080.00415.81
7.1.100.0100.00416.39
7.1.90.0060.00715.53
7.1.80.0120.00215.77
7.1.70.0080.00416.00
7.1.60.0090.00816.96
7.1.50.0100.00616.11
7.1.40.0030.01015.65
7.1.30.0070.00515.70
7.1.20.0080.00315.56
7.1.10.0060.00815.60
7.1.00.0040.03017.90
7.0.330.0050.00615.36
7.0.320.0080.00115.48
7.0.310.0090.00315.29
7.0.300.0100.00315.51
7.0.290.0090.00615.38
7.0.280.0120.00315.39
7.0.270.0090.00515.41
7.0.260.0080.00315.41
7.0.250.0110.00315.55
7.0.240.0060.00815.47
7.0.230.0080.00515.53
7.0.220.0080.00515.40
7.0.210.0080.00315.46
7.0.200.0050.00715.88
7.0.190.0030.01015.50
7.0.180.0040.00715.34
7.0.170.0090.00315.45
7.0.160.0040.00715.58
7.0.150.0060.00615.42
7.0.140.0080.02417.69
7.0.130.0050.00815.53
7.0.120.0090.00215.58
7.0.110.0080.00615.38
7.0.100.0080.00515.59
7.0.90.0060.00715.44
7.0.80.0090.00315.34
7.0.70.0060.00715.33
7.0.60.0050.03216.88
7.0.50.0030.01916.23
7.0.40.0060.03216.38
7.0.30.0170.02516.27
7.0.20.0210.01816.43
7.0.10.0050.03416.42
7.0.00.0080.02916.32
5.6.400.0110.00214.27
5.6.390.0040.00914.12
5.6.380.0070.00314.26
5.6.370.0040.00913.94
5.6.360.0100.00314.22
5.6.350.0080.00514.27
5.6.340.0060.00614.38
5.6.330.0080.00614.25
5.6.320.0090.00414.29
5.6.310.0060.00714.10
5.6.300.0030.00914.24
5.6.290.0080.00614.23
5.6.280.0070.02816.59
5.6.270.0110.00214.14
5.6.260.0070.00614.20
5.6.250.0090.00314.20
5.6.240.0060.00914.21
5.6.230.0050.00914.17
5.6.220.0040.00814.17
5.6.210.0080.03016.33
5.6.200.0050.03315.50
5.6.190.0070.01716.45
5.6.180.0060.01616.30
5.6.170.0100.01816.26
5.6.160.0070.03016.31
5.6.150.0050.03115.71
5.6.140.0080.03015.53
5.6.130.0080.03215.49
5.6.120.0050.03516.56
5.6.110.0050.03516.46
5.6.100.0080.02216.42
5.6.90.0110.01516.52
5.6.80.0070.02716.26
5.6.70.0090.00414.27
5.6.60.0080.00514.20
5.6.50.0090.00214.06
5.6.40.0060.00814.22
5.6.30.0120.00314.12
5.6.20.0090.00514.22
5.6.10.0090.00214.15
5.6.00.0080.00614.24
5.5.380.0040.01014.20
5.5.370.0030.00914.21
5.5.360.0050.00713.99
5.5.350.1280.01416.17
5.5.340.0030.01915.36
5.5.330.0040.02216.37
5.5.320.0130.01916.24
5.5.310.0120.01816.32
5.5.300.0040.03315.39
5.5.290.0070.02115.37
5.5.280.0060.03016.49
5.5.270.0090.03016.56
5.5.260.0070.01816.34
5.5.250.0110.02316.24
5.5.240.0080.02916.30
5.5.230.0050.00814.22
5.5.220.0100.00314.21
5.5.210.0040.00614.06
5.5.200.0090.00314.27
5.5.190.0110.00314.22
5.5.180.0050.00613.91
5.5.170.0060.00614.07
5.5.160.0080.00314.02
5.5.150.0060.00614.15
5.5.140.0080.00313.97
5.5.130.0080.00514.00
5.5.120.0070.00513.99
5.5.110.0090.00314.06
5.5.100.0080.00414.06
5.5.90.0090.00414.02
5.5.80.0080.00614.17
5.5.70.0080.00514.12
5.5.60.0090.00414.07
5.5.50.0060.00614.17
5.5.40.0070.00313.95
5.5.30.0070.00314.12
5.5.20.0040.00614.17
5.5.10.0110.00414.19
5.5.00.0040.00913.99
5.4.450.0200.02514.86
5.4.440.0150.02114.68
5.4.430.0170.02014.73
5.4.420.0150.01814.88
5.4.410.0180.01214.69
5.4.400.0160.02014.70
5.4.390.0170.02014.75
5.4.380.0170.01914.77
5.4.370.0140.01714.77
5.4.360.0170.01514.75
5.4.350.0160.02814.80
5.4.340.0240.02114.68
5.4.330.0040.00612.54
5.4.320.0180.01714.80
5.4.310.0230.01614.75
5.4.300.0210.02414.69
5.4.290.0250.02214.74
5.4.280.0190.02914.79
5.4.270.0190.02714.77
5.4.260.0220.02314.76
5.4.250.0220.02314.69
5.4.240.0190.01514.73
5.4.230.0200.02714.53
5.4.220.0170.01914.75
5.4.210.0170.01514.61
5.4.200.0220.02414.65
5.4.190.0210.02014.75
5.4.180.0200.02514.72
5.4.170.0210.01514.70
5.4.160.0230.02414.60
5.4.150.0200.01614.66
5.4.140.0230.02113.86
5.4.130.0180.01513.70
5.4.120.0210.02213.71
5.4.110.0230.01713.87
5.4.100.0190.01613.73
5.4.90.0230.02213.78
5.4.80.0190.01813.82
5.4.70.0180.01713.81
5.4.60.0200.02713.87
5.4.50.0240.01613.71
5.4.40.0250.01213.85
5.4.30.0150.01813.80
5.4.20.0170.01713.81
5.4.10.0210.02613.87
5.4.00.0190.01513.71
5.3.290.0210.02213.43
5.3.280.0210.01913.36
5.3.270.0180.02013.48
5.3.260.0180.02713.44
5.3.250.0200.02413.56
5.3.240.0170.01713.34
5.3.230.0190.02213.41
5.3.220.0190.01813.36
5.3.210.0200.01813.48
5.3.200.0170.01813.42
5.3.190.0170.01913.49
5.3.180.0180.02213.51
5.3.170.0200.01613.63
5.3.160.0220.02213.53
5.3.150.0150.02313.62
5.3.140.0230.02413.44
5.3.130.0200.01513.45
5.3.120.0130.01913.44
5.3.110.0170.01713.44
5.3.100.0150.01613.40
5.3.90.0170.01613.18
5.3.80.0180.02213.27
5.3.70.0170.02713.23
5.3.60.0160.01913.38
5.3.50.0180.01713.21
5.3.40.0180.02413.13
5.3.30.0160.01613.25
5.3.20.0180.01213.21
5.3.10.0180.02512.97
5.3.00.0210.02212.98
5.2.170.0200.02012.40
5.2.160.0220.02812.39
5.2.150.0210.02212.37
5.2.140.0180.02612.27
5.2.130.0180.03112.25
5.2.120.0180.01712.21
5.2.110.0180.02012.29
5.2.100.0220.01712.44
5.2.90.0150.01812.38
5.2.80.0150.02012.25
5.2.70.0180.02112.34
5.2.60.0260.02812.22
5.2.50.0210.01812.25
5.2.40.0130.02312.29
5.2.30.0170.02112.22
5.2.20.0180.01612.22
5.2.10.0170.02912.26
5.2.00.0180.02812.12
5.1.60.0210.02511.76
5.1.50.0200.02411.71
5.1.40.0150.02712.02
5.1.30.0150.01811.98
5.1.20.0170.01511.88
5.1.10.0130.01611.97
5.1.00.0190.02511.77
5.0.50.0120.01011.64
5.0.40.0080.02511.64
5.0.30.0100.02711.64
5.0.20.0080.01611.64
5.0.10.0130.02011.64
5.0.00.0120.03111.64
4.4.90.0120.01411.64
4.4.80.0080.01011.64
4.4.70.0080.01111.64
4.4.60.0120.01311.64
4.4.50.0100.01311.64
4.4.40.0130.02311.64
4.4.30.0080.01711.64
4.4.20.0100.01111.64
4.4.10.0080.01811.64
4.4.00.0070.01511.64
4.3.110.0070.00911.64
4.3.100.0100.00611.64
4.3.90.0130.00511.64
4.3.80.0100.01211.64
4.3.70.0070.00811.64
4.3.60.0080.01211.64
4.3.50.0080.00811.64
4.3.40.0080.01211.64
4.3.30.0030.00911.64
4.3.20.0040.01211.64
4.3.10.0040.01011.64
4.3.00.0090.01511.64

preferences:
47.55 ms | 401 KiB | 5 Q