3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'www.example.com/title/page/article/'; //this is the URL $urlArray = explode('/', $url); //Strip down the URL $startURL = $urlArray[0]; //we want to keep this for if the user clicks on start. $urlArray[0] = 'Start'; //replace www.example.com with "start" if($urlArray[count($urlArray) - 1] == ''){ //this checks the last item is being empty or not. array_pop($urlArray); //last item is indeed empty so we just remove it. } $broadCrumb = ''; //create an empty broadCrumb variable Foreach($urlArray as $index =>$value){ //loop through the stripped down url $value = ucfirst($value); //initcap the items $broadCrumbTemp = '<a href="'.$startURL.'/{url}">{linkname}</a>{delimeter}'; //this is the template we are going to use. if($index == (count($urlArray) - 1)){ //if the index is last $broadCrumb .= $value; //just append the item }else{ //if the index isn't last $location = ''; for($i = 1; $i <= $index; $i++){ $location .= $urlArray[$i].'/'; } $replace = array('{url}', '{linkname}', '{delimeter}'); $replaceTo = array($location, $value, ' > '); $broadCrumbTemp = str_ireplace($replace, $replaceTo, $broadCrumbTemp); $broadCrumb .= $broadCrumbTemp; } } echo($broadCrumb); //show the broadCrumb

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.70.0130.01016.63
8.3.60.0110.01116.88
8.3.50.0120.00821.30
8.3.40.0040.01118.79
8.3.30.0150.00018.84
8.3.20.0050.00320.33
8.3.10.0080.00021.68
8.3.00.0030.00619.71
8.2.190.0100.01316.63
8.2.180.0100.00625.92
8.2.170.0180.00319.13
8.2.160.0090.00622.96
8.2.150.0070.01025.66
8.2.140.0070.01024.66
8.2.130.0060.00326.16
8.2.120.0050.00317.63
8.2.110.0060.00322.08
8.2.100.0080.00417.84
8.2.90.0050.00317.91
8.2.80.0030.00519.14
8.2.70.0040.00417.63
8.2.60.0000.00917.68
8.2.50.0000.00818.07
8.2.40.0050.00319.26
8.2.30.0000.00720.64
8.2.20.0000.00817.63
8.2.10.0070.00018.07
8.2.00.0070.00018.12
8.1.280.0120.00325.92
8.1.270.0070.00024.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00422.03
8.1.230.0040.00720.89
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0030.00617.50
8.1.190.0040.00417.25
8.1.180.0040.00418.10
8.1.170.0040.00418.57
8.1.160.0050.00321.93
8.1.150.0000.00718.89
8.1.140.0080.00017.44
8.1.130.0000.00717.77
8.1.120.0080.00017.54
8.1.110.0000.00717.51
8.1.100.0040.00417.46
8.1.90.0050.00317.50
8.1.80.0000.00717.43
8.1.70.0040.00417.35
8.1.60.0060.00317.47
8.1.50.0040.00417.42
8.1.40.0000.00817.50
8.1.30.0000.00817.61
8.1.20.0030.00617.65
8.1.10.0060.00317.58
8.1.00.0040.00417.53
8.0.300.0040.00420.21
8.0.290.0040.00416.63
8.0.280.0080.00018.50
8.0.270.0000.00717.26
8.0.260.0030.00317.27
8.0.250.0000.00716.98
8.0.240.0040.00416.90
8.0.230.0040.00416.89
8.0.220.0070.00016.89
8.0.210.0030.00316.81
8.0.200.0000.00616.95
8.0.190.0000.00916.94
8.0.180.0000.00716.88
8.0.170.0040.00416.79
8.0.160.0000.00716.89
8.0.150.0050.00316.89
8.0.140.0050.00216.69
8.0.130.0030.00313.26
8.0.120.0000.00816.89
8.0.110.0000.00716.82
8.0.100.0030.00516.92
8.0.90.0030.00416.96
8.0.80.0120.00316.84
8.0.70.0000.00716.73
8.0.60.0000.00716.88
8.0.50.0040.00416.88
8.0.30.0050.01217.07
8.0.20.0100.01017.40
8.0.10.0040.00416.81
8.0.00.0110.01116.84
7.4.330.0050.00015.13
7.4.320.0030.00316.51
7.4.300.0040.00416.61
7.4.290.0000.00716.45
7.4.280.0110.00016.61
7.4.270.0030.00316.52
7.4.260.0070.00016.50
7.4.250.0070.00016.38
7.4.240.0050.00216.63
7.4.230.0030.00316.59
7.4.220.0100.00716.47
7.4.210.0030.01216.57
7.4.200.0000.00716.71
7.4.160.0080.00816.60
7.4.150.0090.01217.40
7.4.140.0110.01217.86
7.4.130.0110.00816.43
7.4.120.0090.00916.44
7.4.110.0120.00616.72
7.4.100.0040.01316.36
7.4.90.0040.01416.57
7.4.80.0140.00919.39
7.4.70.0130.00616.60
7.4.60.0050.01016.58
7.4.50.0000.00616.55
7.4.40.0030.01316.66
7.4.30.0100.01016.70
7.4.00.0050.01014.97
7.3.330.0030.00313.08
7.3.320.0060.00013.16
7.3.310.0000.00716.41
7.3.300.0070.00016.36
7.3.290.0070.00016.36
7.3.280.0070.01316.32
7.3.270.0120.00617.40
7.3.260.0130.01016.52
7.3.240.0190.00316.53
7.3.230.0030.01316.39
7.3.210.0030.01316.50
7.3.200.0090.00916.57
7.3.190.0040.01416.50
7.3.180.0090.01216.64
7.3.170.0060.01516.47
7.3.160.0110.00716.43
7.3.120.0130.00714.58
7.3.110.0060.01214.91
7.3.100.0030.01014.88
7.3.90.0140.00015.04
7.3.80.0070.01014.82
7.3.70.0060.01014.90
7.3.60.0100.00314.79
7.3.50.0040.01114.82
7.3.40.0120.00014.95
7.3.30.0040.01114.69
7.3.20.0030.00916.73
7.3.10.0110.00316.88
7.3.00.0060.00616.78
7.2.330.0100.00716.55
7.2.320.0120.00616.71
7.2.310.0030.01316.48
7.2.300.0040.01316.78
7.2.290.0060.00916.90
7.2.250.0060.01214.93
7.2.240.0100.00715.30
7.2.230.0080.00415.08
7.2.220.0030.01315.22
7.2.210.0090.00614.96
7.2.200.0100.00615.14
7.2.190.0110.00015.11
7.2.180.0030.00914.88
7.2.170.0100.00015.22
7.2.60.0070.00716.59
7.2.50.0100.00317.11
7.1.330.0080.00615.88
7.1.320.0140.00015.70
7.1.310.0000.01015.98
7.1.300.0090.00615.76
7.1.290.0100.00715.70
7.1.280.0080.00015.65
7.1.270.0060.00915.82
7.1.260.0070.00716.02
7.1.200.0090.00315.94
7.1.70.0000.00716.92
7.1.60.0030.01619.27
7.1.50.0070.00416.99
7.1.00.0100.06722.34
7.0.200.0140.00416.64
7.0.100.0200.06319.95
7.0.90.0170.08719.90
7.0.80.0200.04719.95
7.0.70.0000.05020.00
7.0.60.0030.08719.94
7.0.50.0030.05720.32
7.0.40.0030.05720.00
7.0.30.0030.04320.10
7.0.20.0000.04720.13
7.0.10.0070.04019.95
7.0.00.0000.04720.07
5.6.280.0070.07021.02
5.6.250.0030.08720.64
5.6.240.0070.04020.55
5.6.230.0170.07020.66
5.6.220.0070.04320.71
5.6.210.0000.05320.64
5.6.200.0100.04021.02
5.6.190.0030.07721.00
5.6.180.0070.04021.11
5.6.170.0100.05021.02
5.6.160.0070.04321.09
5.6.150.0030.04320.96
5.6.140.0070.03721.02
5.6.130.0030.04021.04
5.6.120.0070.03721.09
5.6.110.0070.03321.04
5.6.100.0070.06321.01
5.6.90.0170.07320.99
5.6.80.0030.05020.42
5.6.70.0070.04020.55
5.6.60.0030.04720.45
5.6.50.0070.04320.52
5.6.40.0070.03720.45
5.6.30.0030.03720.33
5.6.20.0030.04020.39
5.6.10.0000.04320.30
5.6.00.0130.03320.38
5.5.380.0130.04020.55
5.5.370.0130.07320.40
5.5.360.0030.04020.41
5.5.350.0100.04020.45
5.5.340.0100.09020.80
5.5.330.0130.06720.92
5.5.320.0100.03020.91
5.5.310.0000.05020.78
5.5.300.0070.04020.89
5.5.290.0030.04720.65
5.5.280.0130.04020.92
5.5.270.0130.03020.88
5.5.260.0070.06720.82
5.5.250.0000.08320.58
5.5.240.0000.06020.25
5.5.230.0030.04320.14
5.5.220.0100.03720.27
5.5.210.0070.04320.03
5.5.200.0100.03320.14
5.5.190.0070.03720.18
5.5.180.0000.04320.15
5.5.160.0030.04020.28
5.5.150.0130.03320.24
5.5.140.0130.03320.13
5.5.130.0100.03020.00
5.5.120.0070.03720.18
5.5.110.0170.02720.26
5.5.100.0030.04020.02
5.5.90.0000.04320.16
5.5.80.0030.03720.13
5.5.70.0000.04320.02
5.5.60.0000.04020.04
5.5.50.0000.04020.15
5.5.40.0000.04320.15
5.5.30.0030.04020.07
5.5.20.0030.04020.11
5.5.10.0000.04319.98
5.5.00.0070.03720.11
5.4.450.0070.03719.38
5.4.440.0000.04319.14
5.4.430.0070.08019.30
5.4.420.0000.04319.55
5.4.410.0100.06019.01
5.4.400.0100.03318.92
5.4.390.0070.03719.03
5.4.380.0070.03719.03
5.4.370.0130.03319.03
5.4.360.0100.03319.19
5.4.350.0030.03719.13
5.4.340.0030.03718.81
5.4.320.0030.03718.96
5.4.310.0030.04019.12
5.4.300.0000.04318.96
5.4.290.0070.03318.97
5.4.280.0070.04019.04
5.4.270.0030.03719.22
5.4.260.0130.03019.02
5.4.250.0030.04318.77
5.4.240.0000.04019.12
5.4.230.0030.03718.96
5.4.220.0070.03719.13
5.4.210.0000.04018.94
5.4.200.0030.03718.93
5.4.190.0030.03719.07
5.4.180.0100.03019.07
5.4.170.0000.04319.09
5.4.160.0030.04018.80
5.4.150.0000.04318.83
5.4.140.0100.06716.38
5.4.130.0130.03716.27
5.4.120.0030.06716.34
5.4.110.0030.06316.32
5.4.100.0070.07016.38
5.4.90.0000.08016.26
5.4.80.0070.04016.19
5.4.70.0030.06716.40
5.4.60.0100.07016.19
5.4.50.0100.06716.39
5.4.40.0100.03716.36
5.4.30.0000.05316.33
5.4.20.0030.05316.20
5.4.10.0070.07016.20
5.4.00.0130.07715.72

preferences:
54.4 ms | 401 KiB | 5 Q