3v4l.org

run code in 300+ PHP versions simultaneously
<?php function alter_macros($content) { preg_match_all('#{(.*)}#Ui', $content, $matches); for($i = 0; $i < count($matches[1]); $i++) { $ns = explode("|", $matches[1][$i]); $c2 = count($ns); $rand = rand(0, ($c2 - 1)); $content = str_replace("{".$matches[1][$i]."}", $ns[$rand], $content); } return $content; } function xnum_macros($content) { preg_match_all('#\[NUM\-([[:digit:]]+)\]#', $content, $matches); for($i = 0; $i < count($matches[0]); $i++) { $num = $matches[1][$i]; $min = pow(10, $num - 1); $max = pow(10, $num) - 1; $rand = rand($min, $max); $content = str_replace($matches[0][$i], $rand, $content); } return $content; } function num_macros($content) { preg_match_all('#\[RAND\-([[:digit:]]+)\-([[:digit:]]+)\]#', $content, $matches); for($i = 0; $i < count($matches[0]); $i++) { $min = $matches[1][$i]; $max = $matches[2][$i]; $rand = rand($min, $max); $content = str_replace($matches[0][$i], $rand, $content); } return $content; } function fteil_macros($content, $fteil) { return str_replace("[FTEIL]", $fteil, $content); } if(!strpos("abc.doc", ".jpg")) { $filename = alter_macros("abc.doc"); $filename = num_macros($filename); $filename = xnum_macros($filename); echo $filename; }

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)
7.3.10.0030.01016.91
7.3.00.0030.01016.92
7.2.130.0000.01717.11
7.2.120.0030.00917.08
7.2.110.0000.01416.97
7.2.100.0000.01417.11
7.2.90.0000.01417.17
7.2.80.0100.00717.20
7.2.70.0070.00717.08
7.2.60.0070.01117.00
7.2.50.0000.01417.12
7.2.40.0070.00717.00
7.2.30.0090.00616.95
7.2.20.0070.00717.20
7.2.10.0030.00916.95
7.2.00.0060.00916.90
7.1.250.0030.00615.67
7.1.70.0000.01117.39
7.1.60.0140.01019.59
7.1.50.0030.02117.04
7.1.00.0030.07722.45
7.0.200.0110.00416.93
7.0.60.0070.07319.91
7.0.50.0130.07718.02
7.0.40.0070.05020.12
7.0.30.0500.07320.36
7.0.20.0230.07020.11
7.0.10.0030.08320.27
7.0.00.0130.08720.25
5.6.280.0070.07021.11
5.6.210.0100.07320.62
5.6.200.0030.06718.26
5.6.190.0030.04720.55
5.6.180.3230.04320.67
5.6.170.0370.07020.56
5.6.160.0070.08720.47
5.6.150.0130.07318.25
5.6.140.0100.06718.19
5.6.130.0100.07718.25
5.6.120.0030.05021.16
5.6.110.0070.08721.13
5.6.100.0000.08321.15
5.6.90.0100.03721.02
5.6.80.0100.06320.41
5.6.70.4030.03720.29
5.5.350.0330.04720.45
5.5.340.0130.02717.95
5.5.330.0170.03020.27
5.5.320.0370.07320.36
5.5.310.0270.04720.22
5.5.300.0000.05318.01
5.5.290.0070.04017.95
5.5.280.0000.04720.81
5.5.270.0030.08020.90
5.5.260.0070.05320.88
5.5.250.0000.08720.70
5.5.240.0270.06320.29
5.4.450.0470.05719.59
5.4.440.0330.04719.55
5.4.430.0170.05019.63
5.4.420.0130.05319.68
5.4.410.0070.06019.36
5.4.400.0130.05318.92
5.4.390.0170.06019.09
5.4.380.0070.05719.21
5.4.370.0070.05319.13
5.4.360.0030.06019.06
5.4.350.0230.04319.11
5.4.340.0030.06019.11
5.4.320.0100.05719.06
5.4.310.0130.06319.16
5.4.300.0170.06019.02
5.4.290.0230.04019.07
5.4.280.0070.05719.11
5.4.270.0130.05019.25
5.4.260.0030.05719.13
5.4.250.0000.07319.05
5.4.240.0070.05719.08
5.4.230.0130.05019.05
5.4.220.0130.05019.00
5.4.210.0170.07019.04
5.4.200.0070.06016.86
5.4.190.0070.06319.25
5.4.180.0170.04319.07
5.4.170.0030.06019.00
5.4.160.0130.04719.06
5.4.150.0000.06318.96
5.4.140.0070.05316.64
5.4.130.0170.04316.52
5.4.120.0070.05316.71
5.4.110.0030.05316.68
5.4.100.0200.04316.46
5.4.90.0000.06016.34
5.4.80.0070.05316.26
5.4.70.0200.05716.66
5.4.60.0200.04016.57
5.4.50.0030.05316.46
5.4.40.0230.04016.32
5.4.30.0100.05016.51
5.4.20.0130.04716.43
5.4.10.0200.04016.63
5.4.00.0130.04715.77
5.3.290.0030.06314.77
5.3.280.0130.04714.82
5.3.270.0170.04714.72
5.3.260.0100.06014.75
5.3.250.0030.07314.84
5.3.240.0100.07014.73
5.3.230.0100.07014.58
5.3.220.0170.06014.75
5.3.210.0230.06314.74
5.3.200.0170.06714.55
5.3.190.0170.06014.57
5.3.180.0070.05314.55
5.3.170.0200.05014.62
5.3.160.0130.05014.79
5.3.150.0100.05014.55
5.3.140.0100.05314.70
5.3.130.0030.05714.60
5.3.120.0030.05714.65
5.3.110.0100.06014.63
5.3.100.0130.06314.13
5.3.90.0100.05014.24
5.3.80.0130.04714.26
5.3.70.0070.05314.05
5.3.60.0170.04314.09
5.3.50.0130.04714.06
5.3.40.0070.05313.96
5.3.30.0100.05313.90
5.3.20.0130.05713.94
5.3.10.0130.04313.70
5.3.00.0070.05313.84
5.2.170.0070.04311.34
5.2.160.0100.04711.19
5.2.150.0130.03711.21
5.2.140.0200.03011.21
5.2.130.0030.06011.34
5.2.120.0070.05311.11
5.2.110.0170.04311.00
5.2.100.0030.04311.31
5.2.90.0070.04711.18
5.2.80.0070.04311.32
5.2.70.0070.04311.34
5.2.60.0100.04011.07
5.2.50.0170.03311.23
5.2.40.0070.04011.02
5.2.30.0070.04011.22
5.2.20.0030.04311.00
5.2.10.0100.03710.89
5.2.00.0030.04310.82
5.1.60.0030.0379.94
5.1.50.0170.02310.01
5.1.40.0070.03310.05
5.1.30.0030.03710.34
5.1.20.0070.03310.32
5.1.10.0070.03310.24
5.1.00.0100.0339.97
5.0.50.0070.0278.64
5.0.40.0030.0308.49
5.0.30.0000.0478.18
5.0.20.0100.0208.33
5.0.10.0070.0238.32
5.0.00.0100.0378.25
4.4.90.0030.0235.86
4.4.80.0000.0236.02
4.4.70.0070.0205.83
4.4.60.0070.0205.86
4.4.50.0030.0235.88
4.4.40.0030.0405.89
4.4.30.0000.0275.95
4.4.20.0070.0205.95
4.4.10.0000.0275.85
4.4.00.0070.0305.95
4.3.110.0030.0205.82
4.3.100.0070.0175.85
4.3.90.0030.0205.79
4.3.80.0000.0375.71
4.3.70.0000.0235.79
4.3.60.0030.0205.71
4.3.50.0000.0275.81
4.3.40.0070.0305.64
4.3.30.0070.0274.45
4.3.20.0030.0204.55
4.3.10.0000.0274.48
4.3.00.0130.0176.82

preferences:
40.72 ms | 401 KiB | 5 Q