3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'SELECT * from `foo` WHERE `foo_id` > 0 LIMIT 5'; $regex = '/ (?P<more1>.*?) (?:WHERE\s+ (?P<where>(?:.(?!GROUP BY|HAVING|ORDER BY|LIMIT))+) )? # removing the ? will capture (?P<more2>.*) /imsx'; \preg_match($regex, $str, $matches); var_dump($matches);
Output for git.master, git.master_jit, rfc.property-hooks
array(7) { [0]=> string(46) "SELECT * from `foo` WHERE `foo_id` > 0 LIMIT 5" ["more1"]=> string(0) "" [1]=> string(0) "" ["where"]=> string(0) "" [2]=> string(0) "" ["more2"]=> string(46) "SELECT * from `foo` WHERE `foo_id` > 0 LIMIT 5" [3]=> string(46) "SELECT * from `foo` WHERE `foo_id` > 0 LIMIT 5" }

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:
32.09 ms | 406 KiB | 5 Q