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(array_keys($keys), array_values($values), $template); }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, string given in /in/3hA0D:34 Stack trace: #0 /in/3hA0D(34): array_keys('/\\[\\item_title\\...') #1 {main} thrown in /in/3hA0D on line 34
Process exited with code 255.

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:
46.75 ms | 401 KiB | 8 Q