3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "01", "1001111", "010011111", "0100111110001110", "0100111011001110", "0100111110011110", "0100111111111111110001110", "0100111011001110", "1011010111", "0100111011001110", ]; $pattern = '/^0*\K(?:[01]*?((?(1)\1)1))+/m'; foreach ($strings as $s) { if (preg_match($pattern, $s, $match)) { echo "$s --> " . $match[0] . PHP_EOL; } }
Output for git.master, git.master_jit, rfc.property-hooks
01 --> 1 1001111 --> 10011 010011111 --> 10011111 0100111110001110 --> 10011111 0100111011001110 --> 10011101100111 0100111110011110 --> 10011111001111 0100111111111111110001110 --> 10011111111111111 0100111011001110 --> 10011101100111 1011010111 --> 1011010111 0100111011001110 --> 10011101100111

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