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.0040.01216.50
8.3.50.0120.00522.11
8.3.40.0040.01118.57
8.3.30.0030.01118.95
8.3.20.0060.00320.32
8.3.10.0080.00023.54
8.3.00.0070.00019.10
8.2.180.0070.00716.38
8.2.170.0110.00422.96
8.2.160.0100.00320.38
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0110.00719.36
8.2.110.0070.00322.27
8.2.100.0040.00817.84
8.2.90.0040.00419.19
8.2.80.0050.00317.97
8.2.70.0080.00017.50
8.2.60.0040.00417.80
8.2.50.0080.00018.07
8.2.40.0080.00021.18
8.2.30.0040.00418.28
8.2.20.0040.00417.78
8.2.10.0040.00418.05
8.2.00.0040.00417.74
8.1.280.0100.00725.92
8.1.270.0040.00423.68
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0070.00323.68
8.1.230.0080.00318.84
8.1.220.0040.00417.74
8.1.210.0090.00018.77
8.1.200.0030.00717.23
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0040.00418.55
8.1.160.0050.00222.07
8.1.150.0080.00018.55
8.1.140.0000.00717.45
8.1.130.0030.00617.38
8.1.120.0000.00717.46
8.1.110.0000.00817.44
8.1.100.0000.00717.44
8.1.90.0000.00717.45
8.1.80.0030.00517.47
8.1.70.0000.00717.40
8.1.60.0000.00917.40
8.1.50.0040.00417.51
8.1.40.0040.00417.55
8.1.30.0030.00517.62
8.1.20.0040.00417.61
8.1.10.0000.00817.52
8.1.00.0040.00417.47
8.0.300.0080.00018.77
8.0.290.0040.00417.05
8.0.280.0030.00318.37
8.0.270.0000.00817.14
8.0.260.0000.00916.70
8.0.250.0040.00416.86
8.0.240.0070.00016.77
8.0.230.0000.00716.86
8.0.220.0040.00416.84
8.0.210.0070.00016.85
8.0.200.0000.00716.77
8.0.190.0040.00416.95
8.0.180.0040.00416.89
8.0.170.0040.00416.74
8.0.160.0000.00716.83
8.0.150.0030.00316.65
8.0.140.0000.00716.76
8.0.130.0030.00313.23
8.0.120.0050.00515.00
8.0.110.0050.00515.09
8.0.100.0060.00415.00
8.0.90.0040.00615.09
8.0.80.0110.00315.12
8.0.70.0040.00615.05
8.0.60.0040.00715.12
8.0.50.0050.00515.06
8.0.30.0120.00415.72
8.0.20.0100.00616.06
8.0.10.0040.00615.25
8.0.00.0070.00715.61
7.4.330.0000.00515.00
7.4.320.0040.00416.41
7.4.300.0070.00016.59
7.4.290.0070.00016.39
7.4.280.0030.00316.62
7.4.270.0030.00516.41
7.4.260.0030.00716.50
7.4.250.0030.00314.78
7.4.240.0040.00515.41
7.4.230.0070.00314.84
7.4.220.0050.01014.90
7.4.210.0040.00915.53
7.4.200.0050.00414.80
7.4.190.0060.00415.01
7.4.180.0050.00213.32
7.4.160.0040.00914.98
7.4.150.0060.00615.29
7.4.140.0100.00416.28
7.4.130.0080.00815.34
7.4.120.0090.00715.31
7.4.110.0160.00014.77
7.4.100.0050.00914.87
7.4.90.0090.00514.78
7.4.80.0140.00916.28
7.4.70.0120.00314.76
7.4.60.0100.00514.77
7.4.50.0040.00314.65
7.4.40.0090.00514.79
7.4.30.0090.00414.72
7.4.20.0080.00413.09
7.4.10.0120.00013.14
7.4.00.0070.00714.39
7.3.330.0030.00313.25
7.3.320.0030.00313.16
7.3.310.0020.00814.57
7.3.300.0060.00314.69
7.3.290.0040.00714.70
7.3.280.0090.00815.50
7.3.270.0140.00015.30
7.3.260.0210.01214.78
7.3.250.0130.00215.23
7.3.240.0080.00714.65
7.3.230.0110.00314.84
7.3.220.0090.00312.99
7.3.210.0080.00714.70
7.3.200.0080.00616.25
7.3.190.0070.00914.64
7.3.180.0080.00614.71
7.3.170.0080.00614.67
7.3.160.0110.00314.78
7.3.150.0000.00813.08
7.3.140.0090.00013.13
7.3.130.0000.00712.99
7.3.120.0070.00614.27
7.3.110.0040.00914.14
7.3.100.0090.00614.20
7.3.90.0020.00714.34
7.3.80.0080.00414.24
7.3.70.0040.00514.31
7.3.60.0070.00714.26
7.3.50.0000.00914.17
7.3.40.0030.00914.17
7.3.30.0040.00814.29
7.3.20.0010.00916.11
7.3.10.0020.00815.99
7.3.00.0070.00616.16
7.2.340.0060.00613.26
7.2.330.0070.00814.98
7.2.320.0150.00014.78
7.2.310.0100.00514.78
7.2.300.0100.00414.94
7.2.290.0100.00814.82
7.2.280.0120.00013.23
7.2.270.0080.00413.22
7.2.260.0070.00513.21
7.2.250.0120.00614.44
7.2.240.0100.00614.48
7.2.230.0050.00914.47
7.2.220.0070.00614.34
7.2.210.0060.00714.34
7.2.200.0100.00414.36
7.2.190.0070.00614.41
7.2.180.0090.00414.53
7.2.170.0090.00514.49
7.2.160.0080.00413.30
7.2.150.0060.00615.07
7.2.140.0080.00415.12
7.2.130.0040.00915.23
7.2.120.0100.00315.01
7.2.110.0130.00015.13
7.2.100.0090.00315.07
7.2.90.0130.00015.00
7.2.80.0090.00315.04
7.2.70.0090.00315.16
7.2.60.0130.00015.15
7.2.50.0080.00515.07
7.2.40.0130.00015.07
7.2.30.0090.00415.20
7.2.20.0130.00015.13
7.2.10.0090.00415.30
7.2.00.0050.00717.15
7.1.330.0080.00515.27
7.1.320.0050.00815.25
7.1.310.0090.00215.38
7.1.300.0060.00815.29
7.1.290.0060.00715.19
7.1.280.0030.00815.21
7.1.270.0070.00615.21
7.1.260.0040.00715.29
7.1.250.0060.00614.20
7.1.240.0090.00314.07
7.1.230.0120.00014.35
7.1.220.0100.00214.11
7.1.210.0120.00014.07
7.1.200.0040.00814.29
7.1.190.0060.00614.10
7.1.180.0080.00414.05
7.1.170.0110.00214.03
7.1.160.0120.00014.20
7.1.150.0100.00214.02
7.1.140.0120.00014.13
7.1.130.0070.00514.03
7.1.120.0080.00414.20
7.1.110.0060.00614.13
7.1.100.0030.00716.16
7.1.90.0090.00314.07
7.1.80.0060.00614.04
7.1.70.0110.00415.46
7.1.60.0080.00916.81
7.1.50.0080.00415.59
7.1.40.0110.00014.05
7.1.30.0120.00014.17
7.1.20.0120.00014.14
7.1.10.0060.00613.96
7.1.00.0060.03918.25
7.0.330.0120.00013.87
7.0.320.0130.00013.91
7.0.310.0060.00614.05
7.0.300.0090.00313.83
7.0.290.0120.00013.97
7.0.280.0110.00013.93
7.0.270.0090.00313.96
7.0.260.0040.00813.99
7.0.250.0070.00514.14
7.0.240.0090.00314.23
7.0.230.0120.00014.01
7.0.220.0060.00614.05
7.0.210.0120.00013.95
7.0.200.0040.00715.26
7.0.190.0070.00513.95
7.0.180.0080.00414.04
7.0.170.0060.00614.19
7.0.160.0120.00014.07
7.0.150.0090.00313.89
7.0.140.0040.04018.01
7.0.130.0110.00013.95
7.0.120.0090.00214.00
7.0.110.0090.00313.90
7.0.100.0000.01114.14
7.0.90.0090.00313.76
7.0.80.0120.00013.84
7.0.70.0060.00613.89
7.0.60.0040.02416.97
7.0.50.0060.03115.81
7.0.40.0130.04016.99
7.0.30.0190.02617.01
7.0.20.0160.03617.02
7.0.10.0080.04316.97
7.0.00.0090.04217.03
5.6.400.0060.00612.79
5.6.390.0060.00612.59
5.6.380.0080.00312.64
5.6.370.0060.00612.48
5.6.360.0070.00412.58
5.6.350.0040.00712.78
5.6.340.0090.00312.47
5.6.330.0060.00612.61
5.6.320.0090.00212.77
5.6.310.0040.00812.48
5.6.300.0050.00612.54
5.6.290.0070.00412.82
5.6.280.0080.03816.76
5.6.270.0040.00712.50
5.6.260.0050.00512.57
5.6.250.0080.00312.59
5.6.240.0050.00512.67
5.6.230.0060.00612.80
5.6.220.0120.00012.74
5.6.210.0090.02916.79
5.6.200.0050.02315.42
5.6.190.0100.04516.69
5.6.180.0190.02116.68
5.6.170.0190.04016.61
5.6.160.0090.04216.63
5.6.150.0050.04415.58
5.6.140.0050.04115.47
5.6.130.0100.04015.48
5.6.120.0050.05216.91
5.6.110.0090.04316.74
5.6.100.0040.02416.85
5.6.90.0070.02516.83
5.6.80.0120.02816.48
5.6.70.0090.00212.62
5.6.60.0100.00012.96
5.6.50.0070.00412.59
5.6.40.0080.00312.81
5.6.30.0070.00412.81
5.6.20.0110.00012.43
5.6.10.0100.00012.60
5.6.00.0070.00412.48
5.5.380.0110.00012.66
5.5.370.0110.00012.57
5.5.360.0090.00312.56
5.5.350.2080.02016.44
5.5.340.0090.03315.34
5.5.330.0050.04616.28
5.5.320.0110.03116.32
5.5.310.0240.03316.40
5.5.300.0120.03015.20
5.5.290.0070.03515.18
5.5.280.0040.04716.67
5.5.270.0090.02816.75
5.5.260.0140.03716.73
5.5.250.0230.02916.59
5.5.240.0070.04216.38
5.5.230.0040.00712.55
5.5.220.0070.00412.63
5.5.210.0070.00412.60
5.5.200.0050.00512.43
5.5.190.0060.00612.61
5.5.180.0110.00012.28
5.5.170.0040.00712.29
5.5.160.0050.00512.46
5.5.150.0110.00012.34
5.5.140.0110.00012.24
5.5.130.0110.00012.30
5.5.120.0110.00012.34
5.5.110.0120.00012.49
5.5.100.0070.00412.79
5.5.90.0070.00412.75
5.5.80.0080.00312.48
5.5.70.0030.00712.63
5.5.60.0110.00012.52
5.5.50.0070.00412.55
5.5.40.0110.00012.56
5.5.30.0100.00012.59
5.5.20.0070.00312.62
5.5.10.0050.00512.34
5.5.00.0070.00412.52
5.4.450.0160.02327.19
5.4.440.0220.02225.30
5.4.430.0080.01922.53
5.4.420.0110.02322.08
5.4.410.0220.01820.52
5.4.400.0100.02519.35
5.4.390.0110.02319.04
5.4.380.0210.02615.53
5.4.370.0280.02215.70
5.4.360.0180.03115.54
5.4.350.0220.02715.53
5.4.340.0190.02815.60
5.4.330.0110.00012.54
5.4.320.0100.01612.54
5.4.310.0070.02112.42
5.4.300.0120.02212.46
5.4.290.0060.02812.57
5.4.280.0070.02712.41
5.4.270.0120.02212.52
5.4.260.0090.02512.52
5.4.250.0130.02312.41
5.4.240.0060.02712.38
5.4.230.0070.02812.46
5.4.220.0020.03112.30
5.4.210.0080.02512.38
5.4.200.0110.02512.37
5.4.190.0060.03112.35
5.4.180.0060.02212.37
5.4.170.0080.01912.52
5.4.160.0070.01912.41
5.4.150.0060.02112.46
5.4.140.0100.01812.28
5.4.130.0060.02012.28
5.4.120.0090.01912.35
5.4.110.0070.01912.26
5.4.100.0060.02012.32
5.4.90.0070.02012.27
5.4.80.0100.01812.32
5.4.70.0100.01912.31
5.4.60.0080.02712.32
5.4.50.0090.03012.33
5.4.40.0090.02312.26
5.4.30.0040.03012.25
5.4.20.0110.02512.28
5.4.10.0050.03112.17
5.4.00.0140.03211.90
5.3.290.0080.02012.88
5.3.280.0130.04612.77
5.3.270.0080.03712.74
5.3.260.0100.03012.81
5.3.250.0090.02612.89
5.3.240.0100.03412.83
5.3.230.0070.02112.70
5.3.220.0070.02212.69
5.3.210.0100.02312.68
5.3.200.0070.02412.75
5.3.190.0120.02012.91
5.3.180.0100.01912.83
5.3.170.0060.02212.93
5.3.160.0080.02112.78
5.3.150.0080.02012.79
5.3.140.0080.02212.80
5.3.130.0070.02312.76
5.3.120.0060.02412.75
5.3.110.0100.01912.60
5.3.100.0070.02012.66
5.3.90.0060.02112.46
5.3.80.0050.02012.37
5.3.70.0060.01812.35
5.3.60.0050.01912.61
5.3.50.0030.02312.52
5.3.40.0050.02212.39
5.3.30.0070.01912.33
5.3.20.0060.02012.29
5.3.10.0080.02112.27
5.3.00.0040.02112.25
5.2.170.0050.01610.54
5.2.160.0050.01510.50
5.2.150.0040.01710.58
5.2.140.0030.01810.61
5.2.130.0070.02010.55
5.2.120.0060.02210.49
5.2.110.0060.02110.57
5.2.100.0050.02110.63
5.2.90.0050.01510.55
5.2.80.0040.02110.52
5.2.70.0030.01810.53
5.2.60.0030.02010.47
5.2.50.0040.01710.45
5.2.40.0060.01610.44
5.2.30.0040.01810.31
5.2.20.0040.01610.45
5.2.10.0030.01510.33
5.2.00.0060.01410.12
5.1.60.0040.0139.56
5.1.50.0060.0139.38
5.1.40.0070.0129.49
5.1.30.0030.0219.83
5.1.20.0050.0199.82
5.1.10.0020.0219.64
5.1.00.0040.0209.62
5.0.50.0020.0158.56
5.0.40.0040.0118.49
5.0.30.0040.0178.40
5.0.20.0020.0138.38
5.0.10.0040.0118.37
5.0.00.0020.0198.37
4.4.90.0020.0117.64
4.4.80.0040.0107.63
4.4.70.0020.0137.63
4.4.60.0030.0127.62
4.4.50.0020.0127.63
4.4.40.0040.0247.60
4.4.30.0020.0127.63
4.4.20.0030.0157.67
4.4.10.0020.0137.67
4.4.00.0030.0177.63
4.3.110.0020.0097.58
4.3.100.0030.0077.58
4.3.90.0020.0097.56
4.3.80.0020.0137.54
4.3.70.0010.0117.56
4.3.60.0020.0097.56
4.3.50.0030.0077.56
4.3.40.0020.0187.52
4.3.30.0020.0106.90
4.3.20.0020.0096.89
4.3.10.0020.0116.87
4.3.00.0030.00817.40

preferences:
41.99 ms | 401 KiB | 5 Q