3v4l.org

run code in 300+ PHP versions simultaneously
<?php $template = ' <div style="border:1px solid blue;padding:10px;"> <h1>[item_title]</h1> <p>[item_text]</p> <a href="[item_link]">[item_link]</a> </div> <div style="border:1px solid blue;padding:10px;"> <h1>[item_title]</h1> <p>[item_text]</p> <a href="[item_link]">[item_link]</a> </div> '; /// ITEM 1 $title = 'title 1'; $text = 'text text text'; $link = 'http://www.google.com'; /// ITEM 2 $title = 'title 2'; $text = 'text2 text2 text2'; $link = 'http://www.google.com'; $regex = array( '/\[\item_title\]/is' => $title, '/\[\item_text\]/is' => $text, '/\[\item_link\]/is' => $link, ); foreach($regex as $keys => $values) { $temp = preg_replace($keys, $values, $template); } echo $temp

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.250.0130.04718.78
5.4.240.0030.07318.99
5.4.230.0070.05018.74
5.4.220.0070.05318.65
5.4.210.0000.06018.99
5.4.200.0100.07718.88
5.4.190.0070.05318.89
5.4.180.0100.06318.88
5.4.170.0100.04718.77
5.4.160.0100.05018.86
5.4.150.0230.06719.02
5.4.140.0070.05316.32
5.4.130.0070.04716.26
5.4.120.0070.05016.30
5.4.110.0070.04716.26
5.4.100.0130.04016.46
5.4.90.0070.04716.50
5.4.80.0100.06316.27
5.4.70.0030.05016.48
5.4.60.0200.04016.37
5.4.50.0170.03716.50
5.4.40.0070.05016.43
5.4.30.0030.05016.37
5.4.20.0070.05016.46
5.4.10.0030.05016.20
5.4.00.0070.06015.71
5.3.280.0070.05014.62
5.3.270.0070.05314.62
5.3.260.0070.05314.63
5.3.250.0070.05014.30
5.3.240.0100.04714.63
5.3.230.0270.04014.47
5.3.220.0070.05014.41
5.3.210.0070.05014.61
5.3.200.0170.04014.61
5.3.190.0000.05714.27
5.3.180.0030.05714.41
5.3.170.0070.05014.59
5.3.160.0030.06314.57
5.3.150.0030.08014.62
5.3.140.0130.04314.26
5.3.130.0030.05314.41
5.3.120.0030.05714.62
5.3.110.0000.06014.55
5.3.100.0130.04313.89
5.3.90.0070.05014.03
5.3.80.0030.05014.17
5.3.70.0070.05013.86
5.3.60.0070.04714.02
5.3.50.0100.05713.98
5.3.40.0000.05313.98
5.3.30.0070.04313.61
5.3.20.0070.04713.71
5.3.10.0030.05313.80
5.3.00.0100.04713.56

preferences:
139.32 ms | 1394 KiB | 7 Q