3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_valid($string) { return preg_match('~(\((?1)*+\)|\[(?1)*+]|{(?1)*+})*\z~A', $string); } $expressions = array(")(){}", "[]({})", "([])", "{()[]}", "([)]", "{()[]}{()[]}{()[]}{()[]}{()[]}"); foreach ($expressions as $expression) { echo "$expression is " , is_valid($expression) , "\n"; }
Output for git.master_jit, git.master, rfc.property-hooks
)(){} is 0 []({}) is 1 ([]) is 1 {()[]} is 1 ([)] is 0 {()[]}{()[]}{()[]}{()[]}{()[]} is 1

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