3v4l.org

run code in 300+ PHP versions simultaneously
<?php sqlTemplate("{{1}} {[2]} {{3: BLABLABLA}}",array()); function sqlTemplate($query,$vars){ $replace = function($matches) use ($vars) { var_dump($matches,$vars); }; return preg_replace_callback('~\{([\[\{])[a-z0-9\_\-]+(\:([^\}]*))?[\]\}]\}~i',$replace, $query); }
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> string(5) "{{1}}" [1]=> string(1) "{" } array(0) { } array(2) { [0]=> string(5) "{[2]}" [1]=> string(1) "[" } array(0) { } array(4) { [0]=> string(16) "{{3: BLABLABLA}}" [1]=> string(1) "{" [2]=> string(11) ": BLABLABLA" [3]=> string(10) " BLABLABLA" } array(0) { }

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:
34.33 ms | 402 KiB | 8 Q