3v4l.org

run code in 300+ PHP versions simultaneously
<?php function joinPath() { $path = ''; $arguments = func_get_args(); $args = array(); foreach($arguments as $a) if($a !== '') $args[] = $a;//Removes the empty elements $arg_count = count($args); for($i=0; $i<$arg_count; $i++) { $folder = $args[$i]; if($i != 0 and $folder[0] == DIRECTORY_SEPARATOR) $folder = substr($folder,1); //Remove the first char if it is a '/' - and its not in the first argument if($i != $arg_count-1 and substr($folder,-1) == DIRECTORY_SEPARATOR) $folder = substr($folder,0,-1); //Remove the last char - if its not in the last argument $path .= $folder; if($i != $arg_count-1) $path .= DIRECTORY_SEPARATOR; //Add the '/' if its not the last element. } return $path; } print(joinPath("blah", "dsdf", "gda"));

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.0070.01016.74
8.3.50.0120.00516.47
8.3.40.0140.00718.97
8.3.30.0120.00318.84
8.3.20.0030.00518.90
8.3.10.0090.00018.76
8.3.00.0050.00319.50
8.2.180.0140.00716.38
8.2.170.0160.00022.96
8.2.160.0100.01318.97
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0060.00319.66
8.2.110.0030.00622.31
8.2.100.0110.00019.45
8.2.90.0090.00317.72
8.2.80.0040.00418.78
8.2.70.0030.00617.50
8.2.60.0040.00417.63
8.2.50.0040.00417.50
8.2.40.0040.00417.75
8.2.30.0080.00017.81
8.2.20.0060.00317.71
8.2.10.0050.00317.67
8.2.00.0050.00517.75
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0030.01026.35
8.1.250.0040.00428.09
8.1.240.0100.00720.75
8.1.230.0040.00817.71
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0080.00017.36
8.1.190.0050.00517.22
8.1.180.0060.00318.10
8.1.170.0000.00817.62
8.1.160.0030.00618.63
8.1.150.0030.00518.56
8.1.140.0000.00817.35
8.1.130.0000.00717.39
8.1.120.0050.00217.44
8.1.110.0000.00717.34
8.1.100.0030.00617.34
8.1.90.0000.00717.43
8.1.80.0040.00317.48
8.1.70.0000.00717.34
8.1.60.0050.00317.56
8.1.50.0000.00717.49
8.1.40.0000.00817.56
8.1.30.0000.00817.70
8.1.20.0080.00417.55
8.1.10.0040.00417.51
8.1.00.0040.00417.50
8.0.300.0040.00418.93
8.0.290.0070.00316.59
8.0.280.0040.00417.91
8.0.270.0030.00317.13
8.0.260.0000.00616.73
8.0.250.0060.00316.96
8.0.240.0060.00316.96
8.0.230.0070.00016.91
8.0.220.0070.00016.95
8.0.210.0040.00416.82
8.0.200.0000.00916.99
8.0.190.0050.00217.02
8.0.180.0040.00416.90
8.0.170.0000.00816.88
8.0.160.0040.00316.91
8.0.150.0080.00016.74
8.0.140.0000.00716.83
8.0.130.0050.00013.32
8.0.120.0060.00316.75
8.0.110.0000.00716.71
8.0.100.0040.00416.89
8.0.90.0000.00716.86
8.0.80.0000.01416.82
8.0.70.0040.00416.76
8.0.60.0030.00516.68
8.0.50.0030.00616.78
8.0.30.0100.00716.86
8.0.20.0110.00916.95
8.0.10.0030.00316.88
8.0.00.0120.00616.89
7.4.330.0030.00313.04
7.4.320.0030.00316.63
7.4.300.0060.00016.65
7.4.290.0040.00716.52
7.4.280.0030.00516.48
7.4.270.0070.00016.63
7.4.260.0000.00613.25
7.4.250.0050.00216.40
7.4.240.0030.00516.57
7.4.230.0000.00716.63
7.4.220.0120.01216.65
7.4.210.0110.00416.66
7.4.200.0000.00816.36
7.4.190.0080.00016.38
7.4.160.0040.01116.32
7.4.150.0170.00016.52
7.4.140.0070.01117.86
7.4.130.0120.00616.49
7.4.120.0060.01216.49
7.4.110.0170.00916.40
7.4.100.0070.01016.64
7.4.90.0110.00616.43
7.4.80.0080.00819.39
7.4.70.0030.01316.52
7.4.60.0060.01216.56
7.4.50.0000.00716.53
7.4.40.0030.01016.60
7.4.30.0080.00816.50
7.4.00.0090.00514.76
7.3.330.0000.00813.37
7.3.320.0000.00613.32
7.3.310.0000.00716.42
7.3.300.0000.00716.18
7.3.290.0050.01116.38
7.3.280.0110.01116.41
7.3.270.0060.01516.38
7.3.260.0120.01316.66
7.3.240.0110.00616.32
7.3.230.0110.01116.58
7.3.210.0060.01016.32
7.3.200.0000.01616.66
7.3.190.0120.00316.37
7.3.180.0060.01016.38
7.3.170.0060.01116.34
7.3.160.0150.00316.44
7.3.120.0070.00914.81
7.3.110.0080.00314.97
7.3.100.0110.00714.54
7.3.90.0060.00915.00
7.3.80.0040.00715.00
7.3.70.0000.00914.86
7.3.60.0030.00914.99
7.3.50.0080.00414.54
7.3.40.0000.01814.72
7.3.30.0110.00414.77
7.3.20.0030.01216.93
7.3.10.0000.01116.77
7.3.00.0000.01416.55
7.2.330.0070.01116.70
7.2.320.0070.01316.49
7.2.310.0100.00716.44
7.2.300.0120.00916.79
7.2.290.0120.00616.92
7.2.250.0060.01314.92
7.2.240.0110.01115.29
7.2.230.0080.00414.94
7.2.220.0040.01115.05
7.2.210.0090.00615.20
7.2.200.0060.00914.96
7.2.190.0060.00314.95
7.2.180.0070.00614.90
7.2.170.0030.00715.13
7.2.60.0090.00616.99
7.2.00.0000.01419.14
7.1.330.0030.01315.98
7.1.320.0040.01115.68
7.1.310.0060.01016.00
7.1.300.0040.00415.80
7.1.290.0100.00715.72
7.1.280.0030.01515.51
7.1.270.0060.00915.90
7.1.260.0080.00015.62
7.1.200.0060.00615.75
7.1.100.0070.00718.11
7.1.70.0030.00617.26
7.1.60.0030.02219.25
7.1.50.0060.01516.99
7.1.00.0070.07022.31
7.0.200.0030.00716.93
7.0.140.0030.06721.97
7.0.120.0000.07021.96
7.0.60.0030.04019.93
7.0.50.0100.06317.87
7.0.40.0000.06017.76
7.0.30.0000.05717.82
7.0.20.0100.08317.72
7.0.10.0070.07717.75
7.0.00.0000.09017.83
5.6.280.0070.07020.78
5.6.210.0030.04020.53
5.6.200.0100.06718.14
5.6.190.0130.07018.25
5.6.180.0070.07718.23
5.6.170.0100.08018.27
5.6.160.0000.07718.28
5.6.150.0000.05318.16
5.6.140.0030.05018.18
5.6.130.0000.09018.19
5.6.120.0070.05318.14
5.6.110.0030.06018.22
5.6.100.0030.08018.11
5.6.90.0170.05018.15
5.6.80.0030.05017.55
5.6.70.0100.03717.56
5.6.60.0130.06317.55
5.6.50.0070.03717.60
5.6.40.0070.08017.60
5.6.30.0130.06717.54
5.6.20.0070.07717.49
5.6.10.0070.08017.54
5.6.00.0070.07317.46
5.5.350.0130.07020.38
5.5.340.0070.08017.95
5.5.330.0130.04717.98
5.5.320.0200.06018.03
5.5.310.0000.08018.03
5.5.300.0070.04318.09
5.5.290.0070.04317.98
5.5.280.0030.04718.03
5.5.270.0070.08318.08
5.5.260.0100.06317.95
5.5.250.0070.04317.78
5.5.240.0000.04317.38
5.5.230.0030.08017.45
5.5.220.0070.04017.33
5.5.210.0070.04717.36
5.5.200.0070.07717.28
5.5.190.0000.07017.29
5.5.180.0100.06017.38
5.5.160.0170.06717.44
5.5.150.0070.07717.32
5.5.140.0070.07717.29
5.5.130.0130.04017.34
5.5.120.0170.07317.29
5.5.110.0030.08317.33
5.5.100.0030.06317.21
5.5.90.0100.04717.19
5.5.80.0030.05317.29
5.5.70.0070.04317.21
5.5.60.0070.07317.18
5.5.50.0100.07717.20
5.5.40.0070.07317.19
5.5.30.0070.07317.22
5.5.20.0100.04717.27
5.5.10.0000.08317.21
5.5.00.0100.04717.26
5.4.450.0070.07719.45
5.4.440.0000.04319.34
5.4.430.0070.04319.44
5.4.420.0070.07019.33
5.4.410.0070.07719.24
5.4.400.0100.07319.12
5.4.390.0030.04019.27
5.4.380.0100.05019.05
5.4.370.0000.04319.05
5.4.360.0170.07019.03
5.4.350.0030.07719.27
5.4.340.0130.07319.10
5.4.320.0170.04019.06
5.4.310.0100.05019.05
5.4.300.0030.08319.10
5.4.290.0100.07719.03
5.4.280.0130.07019.03
5.4.270.0130.07319.02
5.4.260.0070.08019.05
5.4.250.0130.06718.97
5.4.240.0070.08019.00
5.4.230.0070.05718.94
5.4.220.0130.06719.13
5.4.210.0100.07019.04
5.4.200.0030.05319.05
5.4.190.0100.04319.00
5.4.180.0130.07019.08
5.4.170.0070.06719.00
5.4.160.0100.06319.10
5.4.150.0000.04019.03
5.4.140.0130.03316.26
5.4.130.0070.05716.32
5.4.120.0070.07716.30
5.4.110.0030.04016.58
5.4.100.0000.06316.40
5.4.90.0130.06016.59
5.4.80.0030.04016.38
5.4.70.0030.06316.41
5.4.60.0070.06716.46
5.4.50.0030.05316.36
5.4.40.0070.07016.50
5.4.30.0070.07016.29
5.4.20.0100.07316.36
5.4.10.0070.05316.44
5.4.00.0100.06715.87
5.3.290.0000.08314.77
5.3.280.0100.04714.63
5.3.270.0030.06314.64
5.3.260.0070.08014.64
5.3.250.0000.04014.66
5.3.240.0070.07314.66
5.3.230.0170.05014.57
5.3.220.0030.07314.52
5.3.210.0130.06014.61
5.3.200.0030.07714.57
5.3.190.0070.05014.63
5.3.180.0070.05014.57
5.3.170.0030.07714.78
5.3.160.0070.08014.41
5.3.150.0070.07314.56
5.3.140.0070.03314.52
5.3.130.0070.05314.59
5.3.120.0030.05014.59
5.3.110.0070.06714.62
5.3.100.0070.07014.03
5.3.90.0070.03714.23
5.3.80.0070.04313.88
5.3.70.0170.02714.00
5.3.60.0030.04014.04
5.3.50.0030.04013.84
5.3.40.0000.05314.00
5.3.30.0030.04013.91
5.3.20.0070.03013.72
5.3.10.0000.03713.71
5.3.00.0030.03313.66
5.2.170.0070.03011.26
5.2.160.0030.03311.22
5.2.150.0070.05011.13
5.2.140.0000.03711.14
5.2.130.0030.03011.16
5.2.120.0070.02311.01
5.2.110.0030.02711.03
5.2.100.0030.02711.07
5.2.90.0030.02711.13
5.2.80.0000.03011.14
5.2.70.0000.03011.18
5.2.60.0030.02711.09
5.2.50.0000.03011.02
5.2.40.0070.02311.10
5.2.30.0030.02710.83
5.2.20.0000.03010.96
5.2.10.0030.02711.08
5.2.00.0000.03010.75
5.1.60.0000.02710.01
5.1.50.0070.02310.11
5.1.40.0000.02710.02
5.1.30.0030.02310.37
5.1.20.0000.02710.36
5.1.10.0000.02710.13
5.1.00.0000.02710.16
5.0.50.0000.0208.61
5.0.40.0000.0238.40
5.0.30.0030.0308.21
5.0.20.0000.0208.23
5.0.10.0000.0208.18
5.0.00.0030.0278.00
4.4.90.0030.0137.80
4.4.80.0030.0107.80
4.4.70.0100.0077.80
4.4.60.0000.0177.80
4.4.50.0070.0107.80
4.4.40.0000.0277.80
4.4.30.0000.0137.80
4.4.20.0030.0137.80
4.4.10.0000.0137.80
4.4.00.0000.0237.80
4.3.110.0000.0137.80
4.3.100.0000.0137.80
4.3.90.0000.0177.80
4.3.80.0000.0237.80
4.3.70.0000.0137.80
4.3.60.0000.0137.80
4.3.50.0030.0107.80
4.3.40.0000.0237.80
4.3.30.0000.0177.80
4.3.20.0000.0137.80
4.3.10.0000.0137.80
4.3.00.0000.0137.80

preferences:
41.18 ms | 401 KiB | 5 Q