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;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: preg_replace(): Compilation failed: unrecognized character follows \ at offset 3 in /in/Dl27l on line 34 Warning: preg_replace(): Compilation failed: unrecognized character follows \ at offset 3 in /in/Dl27l on line 34 Warning: preg_replace(): Compilation failed: unrecognized character follows \ at offset 3 in /in/Dl27l on line 34

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
35.14 ms | 401 KiB | 8 Q