3v4l.org

run code in 300+ PHP versions simultaneously
<?php $searchArray = array('settings all','print', 'sum', 'industry'); // total 50K words function sanitize($string,$searchArray) { $repl = array_map("dashReplace", $searchArray); $pattern = array_map("insertWordBoundaries", $searchArray); $string = preg_replace($pattern,$repl,$string); return $string; } function dashReplace($str) { return "<span class='txtOlg'>" . $str . "</span>"; } function insertWordBoundaries($str){ return "/\b". preg_quote($str,"/") ."\b/"; } $text = 'Lorem Ipsum is simply dummy text of the printing and typesettings all industry.'; echo sanitize($text,$searchArray);
Output for git.master, git.master_jit, rfc.property-hooks
Lorem Ipsum is simply dummy text of the printing and typesettings all <span class='txtOlg'>industry</span>.

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