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.40.0120.00318.44
8.3.30.0070.00718.80
8.3.20.0040.00420.04
8.3.10.0040.00423.61
8.3.00.0000.00720.95
8.2.170.0030.01022.96
8.2.160.0070.00720.60
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.22
8.2.110.0070.00319.18
8.2.100.0110.00017.78
8.2.90.0040.00419.23
8.2.80.0060.00317.97
8.2.70.0030.00517.50
8.2.60.0060.00318.03
8.2.50.0000.00818.10
8.2.40.0060.00319.95
8.2.30.0000.00718.13
8.2.20.0000.00717.59
8.2.10.0030.00317.93
8.2.00.0000.00917.67
8.1.270.0040.00423.88
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0070.00322.23
8.1.230.0040.00717.89
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0080.00017.23
8.1.190.0030.00617.23
8.1.180.0050.00318.10
8.1.170.0050.00318.46
8.1.160.0000.00721.91
8.1.150.0000.00718.55
8.1.140.0040.00417.33
8.1.130.0000.00717.75
8.1.120.0080.00017.49
8.1.110.0040.00417.46
8.1.100.0000.00717.35
8.1.90.0040.00417.34
8.1.80.0000.00717.52
8.1.70.0000.00817.34
8.1.60.0080.00017.51
8.1.50.0000.00917.51
8.1.40.0030.00517.55
8.1.30.0030.00517.64
8.1.20.0000.00717.63
8.1.10.0030.00617.41
8.1.00.0000.00817.46
8.0.300.0060.00318.77
8.0.290.0050.00316.63
8.0.280.0000.00718.29
8.0.270.0070.00017.18
8.0.260.0030.00317.25
8.0.250.0040.00416.82
8.0.240.0000.00716.86
8.0.230.0040.00416.87
8.0.220.0000.00716.85
8.0.210.0030.00316.85
8.0.200.0000.00616.89
8.0.190.0030.00616.84
8.0.180.0040.00416.80
8.0.170.0000.00816.88
8.0.160.0070.00016.71
8.0.150.0020.00516.72
8.0.140.0070.00016.79
8.0.130.0030.00613.24
8.0.120.0040.00614.98
8.0.110.0060.00415.02
8.0.100.0060.00415.07
8.0.90.0060.00415.03
8.0.80.0050.01115.06
8.0.70.0070.00315.05
8.0.60.0060.00414.99
8.0.50.0070.00315.07
8.0.30.0110.00615.82
8.0.20.0110.00716.05
8.0.10.0020.00815.18
8.0.00.0070.00915.60
7.4.330.0050.00015.00
7.4.320.0030.00616.59
7.4.300.0030.00316.63
7.4.290.0000.00716.51
7.4.280.0030.00316.54
7.4.270.0000.00716.66
7.4.260.0020.00516.38
7.4.250.0050.00214.80
7.4.240.0070.00215.48
7.4.230.0050.00614.97
7.4.220.0080.00714.83
7.4.210.0080.00515.44
7.4.200.0030.00614.91
7.4.190.0020.00815.03
7.4.180.0000.00613.41
7.4.160.0030.00814.82
7.4.150.0040.00715.31
7.4.140.0080.00716.34
7.4.130.0140.00315.36
7.4.120.0090.00715.44
7.4.110.0050.01214.78
7.4.100.0090.00514.94
7.4.90.0130.00214.85
7.4.80.0070.00716.28
7.4.70.0070.00714.83
7.4.60.0090.00614.85
7.4.50.0030.00514.85
7.4.40.0080.00714.79
7.4.30.0090.00814.80
7.4.20.0120.00013.12
7.4.10.0080.00413.18
7.4.00.0040.01114.44
7.3.330.0060.00013.11
7.3.320.0000.00513.04
7.3.310.0090.00114.71
7.3.300.0080.00114.71
7.3.290.0070.00514.60
7.3.280.0090.00715.43
7.3.270.0100.00515.21
7.3.260.0120.00314.71
7.3.250.0070.00815.32
7.3.240.0120.00414.83
7.3.230.0070.01114.72
7.3.220.0050.00712.93
7.3.210.0130.00214.70
7.3.200.0090.00616.19
7.3.190.0050.00914.64
7.3.180.0120.00314.62
7.3.170.0100.00414.78
7.3.160.0110.00514.72
7.3.150.0030.00613.15
7.3.140.0030.00613.09
7.3.130.0000.00812.91
7.3.120.0080.00614.32
7.3.110.0070.00513.96
7.3.100.0030.01014.03
7.3.90.0070.00214.00
7.3.80.0050.00513.83
7.3.70.0050.00613.88
7.3.60.0040.00513.85
7.3.50.0000.01013.79
7.3.40.0050.00314.03
7.3.30.0020.00813.98
7.3.20.0070.00415.80
7.3.10.0030.00515.61
7.3.00.0050.00515.71
7.2.340.0040.00813.23
7.2.330.0110.00514.83
7.2.320.0090.00614.85
7.2.310.0080.00814.86
7.2.300.0130.00514.70
7.2.290.0090.00814.87
7.2.280.0060.00613.16
7.2.270.0080.00413.21
7.2.260.0090.00413.05
7.2.250.0080.00814.05
7.2.240.0020.01414.17
7.2.230.0070.00613.85
7.2.220.0040.00714.10
7.2.210.0060.00614.18
7.2.200.0080.00714.22
7.2.190.0080.00314.14
7.2.180.0080.00614.14
7.2.170.0070.00614.13
7.2.160.0110.00313.36
7.2.150.0100.00315.11
7.2.140.0040.00815.07
7.2.130.0130.00015.30
7.2.120.0110.00415.00
7.2.110.0050.00815.13
7.2.100.0100.00315.18
7.2.90.0090.00315.07
7.2.80.0090.00315.02
7.2.70.0080.00415.07
7.2.60.0080.00515.85
7.2.50.0070.00715.11
7.2.40.0100.00315.11
7.2.30.0090.00414.98
7.2.20.0150.00015.25
7.2.10.0090.00415.09
7.2.00.0080.00617.39
7.1.330.0060.00615.02
7.1.320.0080.00214.89
7.1.310.0080.00315.03
7.1.300.0060.00515.10
7.1.290.0120.00114.93
7.1.280.0020.01114.93
7.1.270.0030.01015.00
7.1.260.0080.00614.85
7.1.250.0120.00314.05
7.1.240.0100.00214.05
7.1.230.0120.00014.27
7.1.220.0100.00314.06
7.1.210.0060.00614.22
7.1.200.0100.00214.97
7.1.190.0080.00414.10
7.1.180.0100.00214.19
7.1.170.0080.00414.13
7.1.160.0090.00314.20
7.1.150.0100.00214.03
7.1.140.0120.00014.16
7.1.130.0120.00013.99
7.1.120.0120.00014.01
7.1.110.0000.01313.96
7.1.100.0080.00416.10
7.1.90.0120.00014.02
7.1.80.0040.00814.01
7.1.70.0070.00415.48
7.1.60.0020.01416.79
7.1.50.0050.01115.46
7.1.40.0100.00314.15
7.1.30.0050.00914.15
7.1.20.0070.00714.13
7.1.10.0060.00614.15
7.1.00.0090.03718.19
7.0.330.0100.00313.81
7.0.320.0120.00013.87
7.0.310.0080.00413.91
7.0.300.0090.00313.93
7.0.290.0060.00613.93
7.0.280.0090.00213.91
7.0.270.0090.00313.98
7.0.260.0040.00814.02
7.0.250.0140.00014.18
7.0.240.0120.00014.04
7.0.230.0120.00014.17
7.0.220.0080.00514.09
7.0.210.0090.00314.07
7.0.200.0030.00615.38
7.0.190.0100.00314.18
7.0.180.0090.00313.98
7.0.170.0120.00014.19
7.0.160.0100.00314.09
7.0.150.0090.00314.04
7.0.140.0080.03617.96
7.0.130.0100.00314.19
7.0.120.0120.00014.21
7.0.110.0120.00014.18
7.0.100.0060.00614.08
7.0.90.0090.00313.92
7.0.80.0080.00413.79
7.0.70.0060.00613.92
7.0.60.0140.03516.91
7.0.50.0060.02415.80
7.0.40.0100.02816.96
7.0.30.0280.03516.96
7.0.20.0140.03117.07
7.0.10.0090.02817.14
7.0.00.0090.02717.07
5.6.400.0110.00012.50
5.6.390.0090.00212.63
5.6.380.0090.00312.58
5.6.370.0110.00012.67
5.6.360.0060.00612.78
5.6.350.0050.00512.67
5.6.340.0110.00012.60
5.6.330.0080.00312.80
5.6.320.0120.00012.63
5.6.310.0140.00012.49
5.6.300.0090.00212.39
5.6.290.0040.00812.74
5.6.280.0070.03716.79
5.6.270.0080.00312.63
5.6.260.0070.00412.50
5.6.250.0000.01112.66
5.6.240.0090.00212.52
5.6.230.0040.00812.71
5.6.220.0070.00512.59
5.6.210.0100.03416.64
5.6.200.0120.03015.47
5.6.190.0060.02316.49
5.6.180.0180.03816.66
5.6.170.0120.02216.53
5.6.160.0090.04216.68
5.6.150.0090.04215.50
5.6.140.0090.04015.43
5.6.130.0070.02215.53
5.6.120.0110.01916.83
5.6.110.0110.04416.72
5.6.100.0090.03316.79
5.6.90.0130.03516.72
5.6.80.0090.03716.53
5.6.70.0110.00012.93
5.6.60.0000.01112.63
5.6.50.0080.00412.59
5.6.40.0000.01112.81
5.6.30.0000.01112.62
5.6.20.0110.00012.43
5.6.10.0130.00012.75
5.6.00.0090.00212.74
5.5.380.0110.00012.55
5.5.370.0090.00312.72
5.5.360.0110.00012.54
5.5.350.2090.02016.41
5.5.340.0090.04015.14
5.5.330.0070.04916.42
5.5.320.0160.01816.54
5.5.310.0170.02216.47
5.5.300.0070.03915.20
5.5.290.0060.02115.22
5.5.280.0100.04316.67
5.5.270.0090.04216.65
5.5.260.0160.02816.75
5.5.250.0090.04216.71
5.5.240.0050.04116.48
5.5.230.0060.00612.45
5.5.220.0070.00412.59
5.5.210.0050.00512.77
5.5.200.0110.00012.54
5.5.190.0110.00012.54
5.5.180.0060.00612.30
5.5.170.0120.00012.47
5.5.160.0100.00312.61
5.5.150.0110.00012.36
5.5.140.0040.00712.17
5.5.130.0080.00312.12
5.5.120.0110.00012.27
5.5.110.0050.00512.33
5.5.100.0080.00412.50
5.5.90.0080.00312.63
5.5.80.0050.00512.65
5.5.70.0070.00412.47
5.5.60.0110.00012.73
5.5.50.0090.00312.74
5.5.40.0060.00612.60
5.5.30.0070.00412.66
5.5.20.0080.00312.73
5.5.10.0050.00512.47
5.5.00.0110.00012.35
5.4.450.0230.02327.45
5.4.440.0200.02225.35
5.4.430.0190.02322.66
5.4.420.0080.02722.04
5.4.410.0130.02320.61
5.4.400.0230.02119.69
5.4.390.0140.02218.94
5.4.380.0140.03315.55
5.4.370.0220.02515.49
5.4.360.0220.02715.63
5.4.350.0200.02715.62
5.4.340.0190.03015.43
5.4.330.0070.00312.66
5.4.320.0090.01812.54
5.4.310.0090.02512.50
5.4.300.0080.02912.48
5.4.290.0100.02012.51
5.4.280.0080.02012.48
5.4.270.0090.02112.46
5.4.260.0040.02612.45
5.4.250.0090.01912.53
5.4.240.0070.02312.42
5.4.230.0120.02812.38
5.4.220.0100.01912.31
5.4.210.0050.02212.46
5.4.200.0100.01812.39
5.4.190.0040.02312.38
5.4.180.0050.02312.35
5.4.170.0080.01912.43
5.4.160.0040.02312.45
5.4.150.0080.01912.37
5.4.140.0030.02512.39
5.4.130.0040.02312.22
5.4.120.0080.01812.28
5.4.110.0060.02212.36
5.4.100.0050.02112.20
5.4.90.0050.02112.25
5.4.80.0070.02112.35
5.4.70.0050.02812.24
5.4.60.0070.02112.29
5.4.50.0080.02112.26
5.4.40.0090.02312.18
5.4.30.0050.02712.20
5.4.20.0070.02212.27
5.4.10.0080.02112.35
5.4.00.0060.02411.88
5.3.290.0100.02112.83
5.3.280.0060.02412.68
5.3.270.0070.02312.89
5.3.260.0080.02312.92
5.3.250.0030.02812.77
5.3.240.0100.02312.70
5.3.230.0060.02512.88
5.3.220.0070.02312.83
5.3.210.0080.02312.74
5.3.200.0060.02912.76
5.3.190.0070.02212.77
5.3.180.0040.02612.78
5.3.170.0070.03012.80
5.3.160.0070.02212.97
5.3.150.0080.03212.78
5.3.140.0090.03012.93
5.3.130.0060.03212.81
5.3.120.0130.03512.76
5.3.110.0070.02912.52
5.3.100.0070.02612.54
5.3.90.0080.03012.60
5.3.80.0060.02912.50
5.3.70.0060.02812.51
5.3.60.0070.02612.44
5.3.50.0080.02412.44
5.3.40.0090.03212.28
5.3.30.0070.02812.47
5.3.20.0070.03912.27
5.3.10.0090.02712.13
5.3.00.0040.03712.18
5.2.170.0090.02710.68
5.2.160.0050.03410.59
5.2.150.0090.03010.65
5.2.140.0040.02310.61
5.2.130.0070.01710.44
5.2.120.0050.01810.50
5.2.110.0030.02510.52
5.2.100.0060.02210.61
5.2.90.0070.03910.57
5.2.80.0070.02310.52
5.2.70.0060.01910.50
5.2.60.0040.02210.34
5.2.50.0040.02310.35
5.2.40.0050.02510.38
5.2.30.0090.03210.43
5.2.20.0090.03010.43
5.2.10.0070.02710.21
5.2.00.0070.03010.22
5.1.60.0040.0229.56
5.1.50.0040.0199.49
5.1.40.0040.0159.51
5.1.30.0050.0169.72
5.1.20.0080.0139.82
5.1.10.0040.0179.64
5.1.00.0060.0149.46
5.0.50.0050.0118.56
5.0.40.0060.0108.49
5.0.30.0040.0198.40
5.0.20.0040.0128.38
5.0.10.0060.0168.38
5.0.00.0040.0198.37
4.4.90.0010.0117.63
4.4.80.0020.0107.63
4.4.70.0010.0127.62
4.4.60.0040.0077.62
4.4.50.0020.0107.63
4.4.40.0020.0147.60
4.4.30.0020.0097.63
4.4.20.0020.0107.67
4.4.10.0020.0107.67
4.4.00.0020.0157.63
4.3.110.0020.0117.58
4.3.100.0020.0097.58
4.3.90.0030.0087.56
4.3.80.0020.0147.54
4.3.70.0030.0087.56
4.3.60.0030.0097.56
4.3.50.0020.0107.56
4.3.40.0030.0137.51
4.3.30.0020.0106.89
4.3.20.0030.0156.88
4.3.10.0000.0166.86
4.3.00.0030.00817.46

preferences:
44.12 ms | 400 KiB | 5 Q