3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keywords = [ 0=>['id'=>1,'slug'=>'getName','url'=>'https://www.getname.com'], 1=>['id'=>2,'slug'=>'testName','url'=>'https://www.testname.com'], 2=>['id'=>3,'slug'=>'ign','url'=>'https://www.ign.com'], ]; $str = "<p>Just a test: getName testName"; echo array_reduce($keywords, function ($c, $v) { return preg_replace('/\\b(' . $v['slug'] . ')\\b/', '<a href="'. $v['url'] . '">$1</a>', $c); }, $str);
Output for git.master, git.master_jit, rfc.property-hooks
<p>Just a test: <a href="https://www.getname.com">getName</a> <a href="https://www.testname.com">testName</a>

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:
24.87 ms | 405 KiB | 5 Q