3v4l.org

run code in 300+ PHP versions simultaneously
<?php function addSchema($url, $shemaToAdd = 'http') { $allowedShemas = array('http', 'https'); if(!in_array($shemaToAdd, $allowedShemas)) { throw new Exception('Shema is not allowed: ' .$shemaToAdd); } foreach($allowedShemas as $shema) { $shema.= '://'; if(substr($url, 0, strlen($shema)) === $shema) { $url = substr($url, 0, strlen($shema)); break; } } return $shemaToAdd . '://' . $url; } $url = ' http://exkavator.ru/trade/parts/message/7113.html'; echo addSchema($url);

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.0100.01016.63
8.3.50.0070.00822.06
8.3.40.0040.01119.02
8.3.30.0140.00019.18
8.3.20.0080.00020.33
8.3.10.0040.00423.61
8.3.00.0000.00820.89
8.2.180.0040.01116.38
8.2.170.0110.00422.96
8.2.160.0100.00320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0110.00326.16
8.2.120.0080.00020.90
8.2.110.0060.00322.25
8.2.100.0080.00322.08
8.2.90.0030.00619.27
8.2.80.0030.00617.97
8.2.70.0000.00817.75
8.2.60.0000.01017.93
8.2.50.0080.00018.07
8.2.40.0040.00418.26
8.2.30.0000.01018.20
8.2.20.0040.00417.68
8.2.10.0050.00217.89
8.2.00.0070.00017.70
8.1.280.0160.00025.92
8.1.270.0030.00623.88
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0050.00523.74
8.1.230.0040.00719.09
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00717.35
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0000.00818.61
8.1.160.0050.00322.04
8.1.150.0000.00818.70
8.1.140.0040.00417.38
8.1.130.0000.00717.84
8.1.120.0000.00717.49
8.1.110.0040.00417.49
8.1.100.0080.00017.47
8.1.90.0040.00417.46
8.1.80.0040.00417.51
8.1.70.0030.00317.48
8.1.60.0000.00917.49
8.1.50.0060.00317.51
8.1.40.0040.00417.52
8.1.30.0050.00317.66
8.1.20.0030.00617.66
8.1.10.0050.00217.39
8.1.00.0050.00317.46
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0080.00018.47
8.0.270.0040.00417.14
8.0.260.0040.00417.14
8.0.250.0080.00017.01
8.0.240.0000.00716.95
8.0.230.0030.00317.01
8.0.220.0000.00816.92
8.0.210.0030.00316.79
8.0.200.0000.00716.96
8.0.190.0040.00416.84
8.0.180.0070.00016.84
8.0.170.0050.00316.99
8.0.160.0030.00516.93
8.0.150.0040.00416.76
8.0.140.0040.00416.91
8.0.130.0030.00313.40
8.0.120.0000.00816.75
8.0.110.0000.00716.89
8.0.100.0030.00516.77
8.0.90.0070.00016.73
8.0.80.0060.01016.89
8.0.70.0050.00316.94
8.0.60.0040.00416.77
8.0.50.0040.00416.97
8.0.30.0120.00516.89
8.0.20.0100.01017.40
8.0.10.0000.00716.91
8.0.00.0090.01016.76
7.4.330.0050.00015.00
7.4.320.0030.00316.57
7.4.300.0000.00616.46
7.4.290.0030.00316.60
7.4.280.0100.00016.52
7.4.270.0030.00316.63
7.4.260.0050.00516.61
7.4.250.0040.00416.47
7.4.240.0020.00516.54
7.4.230.0000.00716.59
7.4.220.0060.01216.64
7.4.210.0080.00516.71
7.4.200.0070.00016.37
7.4.160.0070.01016.66
7.4.150.0130.00417.40
7.4.140.0120.00617.86
7.4.130.0110.00616.50
7.4.120.0070.01216.53
7.4.110.0070.01416.34
7.4.100.0090.00916.56
7.4.90.0140.00316.46
7.4.80.0090.01319.39
7.4.70.0080.00816.73
7.4.60.0100.00716.66
7.4.50.0040.00416.42
7.4.40.0090.00616.58
7.4.30.0000.01516.52
7.4.00.0030.01214.88
7.3.330.0080.00013.36
7.3.320.0020.00213.39
7.3.310.0030.00316.45
7.3.300.0050.00216.33
7.3.290.0130.00616.39
7.3.280.0070.01116.33
7.3.270.0120.00617.40
7.3.260.0040.01216.26
7.3.250.0140.00316.54
7.3.240.0070.01116.40
7.3.230.0110.00716.39
7.3.210.0070.01016.56
7.3.200.0060.01119.39
7.3.190.0070.01016.71
7.3.180.0070.01016.67
7.3.170.0080.00816.61
7.3.160.0080.00816.64
7.3.120.0090.00914.79
7.3.110.0060.01314.47
7.3.100.0040.00814.54
7.3.90.0090.00615.04
7.3.80.0110.00414.84
7.3.70.0000.01114.79
7.3.60.0000.01714.91
7.3.50.0070.01014.80
7.3.40.0000.01514.59
7.3.30.0030.01214.54
7.3.20.0080.00416.62
7.3.10.0030.00716.41
7.3.00.0030.00616.80
7.2.330.0100.00716.75
7.2.320.0040.01916.71
7.2.310.0140.00316.69
7.2.300.0090.01216.50
7.2.290.0130.01016.57
7.2.250.0100.00615.12
7.2.240.0080.00815.01
7.2.230.0120.00415.09
7.2.220.0040.01415.22
7.2.210.0070.01015.02
7.2.200.0060.00914.70
7.2.190.0000.01315.15
7.2.180.0000.01514.73
7.2.170.0030.01215.04
7.2.60.0000.01416.95
7.2.00.0100.00319.57
7.1.330.0090.00616.00
7.1.320.0070.00715.98
7.1.310.0090.00615.84
7.1.300.0060.00915.84
7.1.290.0130.00315.79
7.1.280.0130.00015.86
7.1.270.0030.01015.80
7.1.260.0060.00315.57
7.1.200.0040.00416.02
7.1.100.0070.00718.00
7.1.70.0100.00017.25
7.1.60.0200.00319.70
7.1.50.0030.01216.80
7.1.00.0000.08022.45
7.0.200.0030.00616.77
7.0.140.0000.07722.20
7.0.100.0030.08320.01
7.0.90.0230.07719.90
7.0.80.0170.04019.87
7.0.70.0100.07719.95
7.0.60.0330.07319.93
7.0.50.0200.07720.35
7.0.40.0070.05720.18
7.0.30.0000.05320.05
7.0.20.0000.07319.96
7.0.10.0130.07320.08
7.0.00.0070.08320.14
5.6.280.0000.07721.16
5.6.250.0100.08020.60
5.6.240.0100.04320.61
5.6.230.0070.08020.61
5.6.220.0000.08320.68
5.6.210.0070.05320.47
5.6.200.0100.08020.94
5.6.190.0030.06321.11
5.6.180.0070.05321.09
5.6.170.0200.06321.07
5.6.160.0030.08321.05
5.6.150.0100.04721.18
5.6.140.0030.05021.08
5.6.130.0130.06321.02
5.6.120.0130.07321.05
5.6.110.0030.08320.97
5.6.100.0130.05721.01
5.6.90.0070.07320.95
5.6.80.0070.04320.57
5.6.70.0130.07320.41
5.6.60.0070.07320.44
5.6.50.0070.07720.43
5.6.40.0230.05720.38
5.6.30.0100.05720.38
5.6.20.0030.08320.34
5.6.10.0130.06320.44
5.6.00.0130.06020.39
5.5.380.0030.08020.42
5.5.370.0030.05320.36
5.5.360.0170.04020.40
5.5.350.0100.06020.43
5.5.340.0070.07720.93
5.5.330.0000.04720.84
5.5.320.0130.07020.93
5.5.310.0130.07320.87
5.5.300.0100.05720.78
5.5.290.0100.08020.74
5.5.280.0100.07320.87
5.5.270.0130.07320.88
5.5.260.0200.07320.91
5.5.250.0070.07720.58
5.5.240.0030.08020.32
5.5.230.0000.07020.27
5.5.220.0070.07720.30
5.5.210.0000.07720.29
5.5.200.0100.04720.18
5.5.190.0030.06019.99
5.5.180.0100.07720.18
5.5.160.0100.05720.16
5.5.150.0170.07320.24
5.5.140.0000.05020.26
5.5.130.0000.05320.13
5.5.120.0130.04019.99
5.5.110.0200.06720.11
5.5.100.0100.07719.95
5.5.90.0030.07019.96
5.5.80.0030.06320.11
5.5.70.0030.06320.06
5.5.60.0130.07020.12
5.5.50.0100.07020.10
5.5.40.0070.03720.05
5.5.30.0130.06320.06
5.5.20.0100.06720.14
5.5.10.0100.06320.04
5.5.00.0030.07020.00
5.4.450.0130.03719.36
5.4.440.0070.07319.53
5.4.430.0000.05019.41
5.4.420.0000.05019.20
5.4.410.0100.06719.43
5.4.400.0030.07018.89
5.4.390.0130.07019.23
5.4.380.0070.06319.14
5.4.370.0070.04719.23
5.4.360.0070.06718.95
5.4.350.0070.06719.13
5.4.340.0070.08019.18
5.4.320.0100.06319.14
5.4.310.0030.04719.09
5.4.300.0100.07019.05
5.4.290.0100.05719.13
5.4.280.0170.06719.04
5.4.270.0070.07718.90
5.4.260.0070.05019.16
5.4.250.0100.03719.02
5.4.240.0030.07019.04
5.4.230.0100.04019.18
5.4.220.0030.08019.03
5.4.210.0000.04719.21
5.4.200.0100.05718.94
5.4.190.0000.06019.08
5.4.180.0170.04319.20
5.4.170.0000.05019.13
5.4.160.0070.07719.16
5.4.150.0100.07719.19
5.4.140.0070.04016.42
5.4.130.0100.06716.40
5.4.120.0030.05716.44
5.4.110.0000.04716.33
5.4.100.0100.07016.47
5.4.90.0000.04316.39
5.4.80.0070.03316.48
5.4.70.0000.04016.33
5.4.60.0100.06716.47
5.4.50.0030.08316.30
5.4.40.0030.04016.54
5.4.30.0030.07316.25
5.4.20.0130.05716.48
5.4.10.0100.06716.29
5.4.00.0070.07315.80
5.3.290.0070.07014.78
5.3.280.0070.07014.69
5.3.270.0070.03714.71
5.3.260.0130.06714.70
5.3.250.0030.08014.67
5.3.240.0000.08014.55
5.3.230.0030.07014.55
5.3.220.0070.07714.71
5.3.210.0030.07714.69
5.3.200.0130.07014.63
5.3.190.0130.07014.57
5.3.180.0070.07314.63
5.3.170.0130.07014.70
5.3.160.0170.03314.68
5.3.150.0070.07714.63
5.3.140.0100.06714.66
5.3.130.0100.06314.66
5.3.120.0100.06314.48
5.3.110.0100.07014.68
5.3.100.0030.08314.16
5.3.90.0070.06314.09
5.3.80.0070.06714.12
5.3.70.0030.03714.04
5.3.60.0130.03714.01
5.3.50.0030.07014.04
5.3.40.0030.04314.00
5.3.30.0130.06713.94
5.3.20.0030.07313.83
5.3.10.0070.06713.71
5.3.00.0170.06013.70
5.2.170.0030.04011.15
5.2.160.0130.05311.00
5.2.150.0070.06311.17
5.2.140.0070.03311.20
5.2.130.0070.06011.11
5.2.120.0030.06011.11
5.2.110.0030.05010.98
5.2.100.0130.02311.16
5.2.90.0000.05311.09
5.2.80.0030.06011.19
5.2.70.0000.06311.18
5.2.60.0070.06010.99
5.2.50.0100.03711.04
5.2.40.0070.05310.86
5.2.30.0030.03310.91
5.2.20.0030.06310.87
5.2.10.0100.03710.87
5.2.00.0030.05010.77
5.1.60.0030.05010.10
5.1.50.0070.04010.03
5.1.40.0000.0439.98
5.1.30.0070.05310.29
5.1.20.0030.06010.47
5.1.10.0030.04310.19
5.1.00.0070.03710.18
5.0.50.0070.0408.66
5.0.40.0000.0308.66
5.0.30.0000.0678.66
5.0.20.0030.0308.66
5.0.10.0000.0478.66
5.0.00.0000.0608.66
4.4.90.0000.0208.66
4.4.80.0030.0178.66
4.4.70.0070.0308.66
4.4.60.0030.0178.66
4.4.50.0000.0278.66
4.4.40.0000.0578.66
4.4.30.0070.0338.66
4.4.20.0030.0338.66
4.4.10.0070.0308.66
4.4.00.0030.0538.66
4.3.110.0070.0308.66
4.3.100.0000.0308.66
4.3.90.0000.0378.66
4.3.80.0000.0508.66
4.3.70.0070.0308.66
4.3.60.0100.0278.66
4.3.50.0000.0278.66
4.3.40.0030.0508.66
4.3.30.0000.0378.66
4.3.20.0070.0278.66
4.3.10.0000.0278.66
4.3.00.0000.0338.66

preferences:
42.16 ms | 401 KiB | 5 Q