3v4l.org

run code in 300+ PHP versions simultaneously
<?php function 2GunNukesSpamUsingDruszAvatar($input) { $blacklist = array('a-xxx-site-with-spam.com','visual.merriam-webster.com','example.com'); $output=$input; foreach ($blacklist as $a_blacklisted) { $output = preg_replace('/<img(.*?)src=.http(.*?)'.str_replace('.','\.',$a_blacklisted).'(.*?)>/', '<img src="http://standardsurvival.com/faces/64/drusz.png">', $output); } return $output; } echo 2GunNukesSpamUsingDruszAvatar('a spammy one: <img src="http://www.a-xxx-site-with-spam.com/test1.jpg">\n'); echo 2GunNukesSpamUsingDruszAvatar('a legit one: <img src="http://www.google.com/test1.jpg">\n'); echo 2GunNukesSpamUsingDruszAvatar('another legit: <img src="http://www.domain.com/test1.jpg">\n'); echo 2GunNukesSpamUsingDruszAvatar('a spammy: <img src="http://visual.merriam-webster.com/test1.jpg">\n'); echo 2GunNukesSpamUsingDruszAvatar('a legit: <img src="http://www.example.com/test1.jpg">\n');

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)
5.4.260.0130.04718.64
5.4.250.0000.05718.82
5.4.240.0000.06718.93
5.4.230.0070.05718.89
5.4.220.0100.05318.92
5.4.210.0030.05718.73
5.4.200.0130.06318.75
5.4.190.0030.05719.06
5.4.180.0100.05718.88
5.4.170.0070.05319.01
5.4.160.0030.05318.82
5.4.150.0070.06718.91
5.4.140.0170.05316.53
5.4.130.0030.06016.42
5.4.120.0100.06016.32
5.4.110.0030.05016.29
5.4.100.0030.05016.55
5.4.90.0030.05016.34
5.4.80.0030.05316.57
5.4.70.0000.05316.61
5.4.60.0100.04316.47
5.4.50.0030.05016.36
5.4.40.0170.05716.49
5.4.30.0030.05016.36
5.4.20.0130.04016.36
5.4.10.0070.04716.39
5.4.00.0130.04015.87
5.3.280.0070.07014.61
5.3.270.0100.04714.60
5.3.260.0000.05714.61
5.3.250.0030.06014.30
5.3.240.0030.05314.62
5.3.230.0170.06014.69
5.3.220.0030.07314.57
5.3.210.0030.08014.58
5.3.200.0070.04714.61
5.3.190.0070.05314.41
5.3.180.0070.04714.58
5.3.170.0130.04314.63
5.3.160.0030.06014.40
5.3.150.0070.05314.43
5.3.140.0000.06014.61
5.3.130.0100.05014.47
5.3.120.0100.04714.57
5.3.110.0200.06314.43
5.3.100.0070.04714.08
5.3.90.0100.04713.89
5.3.80.0070.05014.02
5.3.70.0070.04714.02
5.3.60.0070.06713.99
5.3.50.0000.05313.79
5.3.40.0100.04713.96
5.3.30.0170.04314.06
5.3.20.0070.04713.78
5.3.10.0070.04713.64
5.3.00.0130.04713.64
5.2.170.0200.04311.04
5.2.160.0070.04011.29
5.2.150.0100.03711.15
5.2.140.0000.04711.07
5.2.130.0030.04011.02
5.2.120.0070.03711.09
5.2.110.0100.03311.11
5.2.100.0170.04710.87
5.2.90.0100.04711.19
5.2.80.0200.04311.21
5.2.70.0070.04711.18
5.2.60.0030.04311.06
5.2.50.0100.03710.95
5.2.40.0100.03711.00
5.2.30.0030.06010.89
5.2.20.0000.06010.96
5.2.10.0070.04710.80
5.2.00.0100.03710.78
5.1.60.0000.0539.78
5.1.50.0030.03310.02
5.1.40.0070.03010.21
5.1.30.0070.03310.32
5.1.20.0100.04310.29
5.1.10.0100.03010.12
5.1.00.0070.0379.91
5.0.50.0100.0278.73
5.0.40.0070.0238.46
5.0.30.0030.0408.45
5.0.20.0030.0278.25
5.0.10.0030.0308.32
5.0.00.0070.0437.94
4.4.90.0030.0206.90
4.4.80.0070.0206.90
4.4.70.0070.0176.90
4.4.60.0030.0206.90
4.4.50.0070.0276.90
4.4.40.0000.0336.90
4.4.30.0070.0176.90
4.4.20.0030.0206.90
4.4.10.0070.0176.90
4.4.00.0030.0406.90
4.3.110.0000.0236.90
4.3.100.0030.0206.90
4.3.90.0070.0276.90
4.3.80.0030.0306.90
4.3.70.0000.0276.90
4.3.60.0070.0176.90
4.3.50.0030.0206.90
4.3.40.0000.0436.90
4.3.30.0030.0206.90
4.3.20.0000.0306.90
4.3.10.0030.0206.90
4.3.00.0130.0209.30

preferences:
140.84 ms | 1394 KiB | 7 Q