3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pre ="<a href=\""; $post= "</a>"; $in = array('http://">http', 'ftp://">ftp', 'mailto://">mailto', '#">HASH', '//">2xfw slash', '\\\\">2x Bw slash', 'file://">file', 'relative/path">relative/path' ); $replacements = array('/((?:href|src) *= *[\'"](?!(http|ftp|mailto|file|javascript|#|[a-z]+:|'. preg_quote('\\\\',"/"). '|\/\/)))(\/?)/i' => "$1" . "http://www.server.tld/ABSOLUTE/PATH/" ); foreach($in as $test) { echo "\n". '<<pre>'; $r = $pre . $test . $post; echo "$r \t\t=>\t\t" . preg_replace(array_keys($replacements), $replacements, $r); echo '</pre>'; }

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.0140.00416.75
8.3.50.0120.00722.11
8.3.40.0070.00719.09
8.3.30.0110.00419.03
8.3.20.0040.00420.34
8.3.10.0080.00021.76
8.3.00.0080.00019.50
8.2.180.0120.00617.13
8.2.170.0210.00019.08
8.2.160.0070.00722.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.61
8.2.110.0030.00619.24
8.2.100.0080.00417.88
8.2.90.0040.00419.34
8.2.80.0040.00417.97
8.2.70.0000.00817.88
8.2.60.0050.00317.93
8.2.50.0000.00818.07
8.2.40.0050.00320.19
8.2.30.0030.00518.23
8.2.20.0030.00517.92
8.2.10.0050.00318.27
8.2.00.0040.00417.92
8.1.280.0090.00925.92
8.1.270.0050.00320.32
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0060.00319.03
8.1.230.0080.00417.60
8.1.220.0030.00617.88
8.1.210.0040.00418.77
8.1.200.0060.00317.47
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0040.00420.56
8.1.160.0040.00422.09
8.1.150.0040.00418.95
8.1.140.0040.00417.73
8.1.130.0000.00717.84
8.1.120.0020.00517.68
8.1.110.0000.00817.66
8.1.100.0040.00417.61
8.1.90.0050.00317.66
8.1.80.0000.00717.53
8.1.70.0030.00617.52
8.1.60.0090.00017.75
8.1.50.0060.00317.69
8.1.40.0000.00817.68
8.1.30.0000.00917.80
8.1.20.0000.00817.77
8.1.10.0030.00717.63
8.1.00.0040.00817.67
8.0.300.0040.00418.77
8.0.290.0050.00317.00
8.0.280.0050.00218.36
8.0.270.0070.00017.30
8.0.260.0000.00717.20
8.0.250.0050.00317.00
8.0.240.0080.00017.12
8.0.230.0000.00717.08
8.0.220.0000.00716.98
8.0.210.0040.00417.10
8.0.200.0030.00617.00
8.0.190.0030.00617.11
8.0.180.0080.00017.12
8.0.170.0000.00817.04
8.0.160.0080.00017.11
8.0.150.0040.00417.08
8.0.140.0040.00417.04
8.0.130.0030.00313.49
8.0.120.0030.00617.09
8.0.110.0040.00417.09
8.0.100.0000.00717.07
8.0.90.0050.00216.98
8.0.80.0040.01817.17
8.0.70.0050.00317.00
8.0.60.0000.00817.13
8.0.50.0070.00017.16
8.0.30.0120.00717.19
8.0.20.0090.01017.46
8.0.10.0000.00717.11
8.0.00.0120.00517.09
7.4.330.0020.00215.22
7.4.320.0030.00316.88
7.4.300.0050.00216.80
7.4.290.0050.00316.80
7.4.280.0030.00616.79
7.4.270.0030.00316.91
7.4.260.0030.00316.89
7.4.250.0000.00816.75
7.4.240.0020.00516.80
7.4.230.0070.00016.78
7.4.220.0070.01116.80
7.4.210.0120.00316.74
7.4.200.0040.00416.69
7.4.160.0090.00616.82
7.4.150.0090.00917.40
7.4.140.0100.01417.86
7.4.130.0100.01016.83
7.4.120.0070.01116.76
7.4.110.0140.00416.88
7.4.100.0170.00616.66
7.4.90.0060.01216.70
7.4.80.0150.00919.39
7.4.70.0120.00616.56
7.4.60.0060.00916.64
7.4.50.0000.00516.73
7.4.40.0110.00616.86
7.4.30.0110.01116.75
7.4.00.0100.00315.01
7.3.330.0000.00613.33
7.3.320.0070.00713.21
7.3.310.0040.00416.48
7.3.300.0000.00716.41
7.3.290.0090.00616.45
7.3.280.0080.00816.45
7.3.270.0090.00917.40
7.3.260.0030.01616.86
7.3.250.0070.01216.58
7.3.240.0210.00016.64
7.3.230.0030.02016.45
7.3.210.0100.00716.86
7.3.200.0110.01219.39
7.3.190.0060.01016.40
7.3.180.0080.01116.45
7.3.170.0100.01216.73
7.3.160.0070.01016.68
7.2.330.0070.01116.80
7.2.320.0060.01617.00
7.2.310.0090.00916.69
7.2.300.0080.00816.95
7.2.290.0170.00516.80
7.1.70.0000.00817.55
7.1.60.0130.01019.50
7.1.50.0110.01817.22
7.1.00.0000.08022.48
7.0.200.0550.00615.18
7.0.140.0030.06322.09
7.0.60.0070.08019.98
7.0.50.0030.04017.93
7.0.40.0070.08720.07
7.0.30.0270.05320.32
7.0.20.0330.07720.04
7.0.10.0170.04020.02
7.0.00.0000.07020.02
5.6.280.0000.07721.02
5.6.210.0070.06020.64
5.6.200.0070.04318.22
5.6.190.0200.07020.77
5.6.180.0300.04720.74
5.6.170.0270.06720.51
5.6.160.0100.08020.39
5.6.150.0030.04018.11
5.6.140.0200.06718.12
5.6.130.0000.04718.09
5.6.120.0130.08021.13
5.6.110.0070.03720.96
5.6.100.0070.08321.08
5.6.90.0070.07720.96
5.6.80.0030.07720.46
5.6.70.0370.06720.50
5.5.350.0130.03720.46
5.5.340.0070.08318.01
5.5.330.0130.07720.37
5.5.320.0000.04020.40
5.5.310.0270.04720.31
5.5.300.0100.06717.95
5.5.290.0000.04318.01
5.5.280.0100.08020.90
5.5.270.0100.03720.88
5.5.260.0030.04020.64
5.5.250.0170.07020.79
5.5.240.0100.07320.18
5.4.450.0200.05719.46
5.4.440.0870.05719.52
5.4.430.0500.05719.47
5.4.420.0200.05719.63
5.4.410.0100.05319.00
5.4.400.0470.07318.76
5.4.390.0400.06018.68
5.4.380.0430.06718.57
5.4.370.0370.05718.59
5.4.360.0400.05018.63
5.4.350.0330.06318.77
5.4.340.0300.05318.68
5.4.320.0370.05318.52
5.4.310.0370.05718.50
5.4.300.0470.05018.73
5.4.290.0400.05718.71
5.4.280.0330.05718.67
5.4.270.0370.07318.56
5.4.260.0430.05718.74
5.4.250.0430.05018.73
5.4.240.0430.06018.55
5.4.230.0300.05718.48
5.4.220.0400.05718.45
5.4.210.0400.05718.66
5.4.200.0400.04716.38
5.4.190.0330.05318.48
5.4.180.0430.05718.66
5.4.170.0300.07018.70
5.4.160.0500.06318.70
5.4.150.0430.07318.53
5.4.140.0400.05016.38
5.4.130.0300.05316.17
5.4.120.0230.05716.31
5.4.110.0330.05716.02
5.4.100.0470.04016.20
5.4.90.0370.07016.25
5.4.80.0570.05716.13
5.4.70.0530.06016.23
5.4.60.0370.04316.25
5.4.50.0330.05316.19
5.4.40.0430.04716.09
5.4.30.0470.05316.27
5.4.20.0400.07316.16
5.4.10.0430.05716.33
5.4.00.0500.04315.54
5.3.290.0330.06714.63
5.3.280.0400.06014.54
5.3.270.0400.07014.53
5.3.260.0400.07714.62
5.3.250.0370.04714.54
5.3.240.0570.06714.59
5.3.230.0430.05314.68
5.3.220.0200.06314.52
5.3.210.0370.06314.50
5.3.200.0530.05714.50
5.3.190.0370.05014.74
5.3.180.0300.06314.55
5.3.170.0330.05314.48
5.3.160.0230.06314.60
5.3.150.0530.05314.52
5.3.140.0470.07014.47
5.3.130.0330.07714.50
5.3.120.0600.05714.53
5.3.110.0470.07014.58
5.3.100.0400.05714.14
5.3.90.0470.05314.09
5.3.80.0330.07014.02
5.3.70.0530.05714.05
5.3.60.0400.06313.95
5.3.50.0470.05313.86
5.3.40.0330.07313.89
5.3.30.0330.05013.82
5.3.20.0470.04313.85
5.3.10.0330.05313.57
5.3.00.0430.05713.62
5.2.170.0370.05311.06
5.2.160.0370.05311.38
5.2.150.0370.04011.28
5.2.140.0200.05311.07
5.2.130.0300.05711.04
5.2.120.0300.04311.15
5.2.110.0270.04711.07
5.2.100.0370.05011.08
5.2.90.0370.04311.09
5.2.80.0300.05311.13
5.2.70.0330.04711.16
5.2.60.0330.04711.19
5.2.50.0230.05010.93
5.2.40.0230.05010.96
5.2.30.0400.04710.95
5.2.20.0300.05011.00
5.2.10.0370.04310.86
5.2.00.0330.05010.76
5.1.60.0330.0409.98
5.1.50.0300.04310.05
5.1.40.0400.03310.01
5.1.30.0400.02710.47
5.1.20.0200.05010.40
5.1.10.0370.04010.14
5.1.00.0130.04710.17
5.0.50.0070.0438.53
5.0.40.0030.0338.44
5.0.30.0170.0408.26
5.0.20.0070.0338.33
5.0.10.0070.0378.21
5.0.00.0100.0478.20
4.4.90.0030.0375.91
4.4.80.0130.0175.90
4.4.70.0170.0235.93
4.4.60.0100.0305.91
4.4.50.0130.0275.88
4.4.40.0170.0335.88
4.4.30.0130.0175.96
4.4.20.0130.0235.97
4.4.10.0130.0275.93
4.4.00.0100.0535.94
4.3.110.0200.0275.83
4.3.100.0130.0275.80
4.3.90.0100.0275.93
4.3.80.0170.0375.79
4.3.70.0100.0275.87
4.3.60.0070.0235.79
4.3.50.0130.0405.88
4.3.40.0070.0405.77
4.3.30.0070.0234.58
4.3.20.0200.0204.52
4.3.10.0030.0304.53
4.3.00.0070.0206.67

preferences:
58.55 ms | 401 KiB | 5 Q