3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = [ ['href' => 'https://www.php.net/', 'name' => 'PHP.net'], ['href' => 'https://stackoverflow.com/', 'name' => 'Stack Overflow'], ['href' => 'https://www.google.com/', 'name' => 'Google'] ]; $rows_by_href = array_reduce($rows, function ($rows_by_href, $row) { $rows_by_href[$row['href']] = $row['name']; return $rows_by_href; }, []); $string = "<a href='https://www.php.net/'>https://www.php.net/</a> <a href='https://stackoverflow.com/'>https://stackoverflow.com/</a> <a href='https://www.google.com/'>https://www.google.com/</a>"; $pattern = "/<a href='(?<href>.+?)'>(?<name>.+?)<\/a>/i"; $result = preg_replace_callback($pattern, function ($matches) use ($rows_by_href) { return "<a href='" . $matches['href'] . "'>" . ($rows_by_href[$matches['href']] ?? $matches['name']) . "</a>"; }, $string); echo $result;
Output for git.master, git.master_jit, rfc.property-hooks
<a href='https://www.php.net/'>PHP.net</a> <a href='https://stackoverflow.com/'>Stack Overflow</a> <a href='https://www.google.com/'>Google</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:
128.41 ms | 405 KiB | 5 Q