3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "(联想 OR 戴尔 OR 苹果 OR 宏基) dangers:(newuuid deep1条 FirstTimeImageRule) 价格_i:[1500 TO 2500] cityEnglishName:beijing categoryEnglishName:bijiben"; if (preg_match_all('/([a-zA-Z]+)\:\(([^\)]+)\)/', $str, $m)) { for ($i = 0; $i < count($m[0]); $i++) { $q = trim($m[0][$i]); if (strlen($q) == 0) continue; $key = $m[1][$i]; $op = strpos($q, ' OR ') ? ' OR ' : ' AND '; $qq = str_replace([" OR ", " AND ", " "], [" OR {$key}:", " AND {$key}:", " {$key}:"], $m[2][$i]); $str = str_replace($q, "(" . $qq. ")", $str); } } var_dump($str);
Output for git.master, git.master_jit, rfc.property-hooks
string(168) "(联想 OR 戴尔 OR 苹果 OR 宏基) (newuuid dangers:deep1条 dangers:FirstTimeImageRule) 价格_i:[1500 TO 2500] cityEnglishName:beijing categoryEnglishName:bijiben"

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