3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "How much is 25.5 + 35.5"; $allowed = array('1','2','3','4','5','6','7', '8', '9','0','-','+','/','*','.'); $regex = sprintf('/([%s]+)/u', preg_quote(join($allowed), '/')); preg_match_all($regex, $result, $match); switch($match[0][1]){ case '-': echo $match[0][0] - $match[0][2]; break; case '*': echo $match[0][0] * $match[0][2]; break; case '+': echo $match[0][0] + $match[0][2]; break; case '/': echo $match[0][0] / $match[0][2]; break; }
Output for rfc.property-hooks, git.master, git.master_jit
61

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:
113.59 ms | 1240 KiB | 4 Q