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; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/7mFA8
function name:  (null)
number of ops:  19
compiled vars:  !0 = $strings, !1 = $pattern, !2 = $s, !3 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1        ASSIGN                                                   !1, '%2F%5E0%2A%5CK%28%3F%3A%5B01%5D%2A%3F%28%28%3F%281%29%5C1%291%29%29%2B%2Fm'
   18     2      > FE_RESET_R                                       $6      !0, ->17
          3    > > FE_FETCH_R                                               $6, !2, ->17
   19     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        SEND_REF                                                 !3
          8        DO_ICALL                                         $7      
          9      > JMPZ                                                     $7, ->16
   20    10    >   NOP                                                      
         11        FAST_CONCAT                                      ~8      !2, '+--%3E+'
         12        FETCH_DIM_R                                      ~9      !3, 0
         13        CONCAT                                           ~10     ~8, ~9
         14        CONCAT                                           ~11     ~10, '%0A'
         15        ECHO                                                     ~11
   18    16    > > JMP                                                      ->3
         17    >   FE_FREE                                                  $6
   22    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.08 ms | 1009 KiB | 14 Q