3v4l.org

run code in 300+ PHP versions simultaneously
<?php function highlightWords($content) { $arr=array("php", "and sql", "sql"); $arr = array_map(function($v){ return "/\b(" . preg_quote($v, "/") . ")\b/i"; }, $arr); print_r($arr); $content=preg_replace($arr, '<a href="#">$1</a>', $content, 1); return $content; } echo highlightWords("This text will highlight PHP and SQL and sql but not PHPRO or MySQL or sqlite");
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => /\b(php)\b/i [1] => /\b(and sql)\b/i [2] => /\b(sql)\b/i ) This text will highlight <a href="#">PHP</a> <a href="#">and <a href="#">SQL</a></a> and sql but not PHPRO or MySQL or sqlite

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