3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (preg_match('/^(?P<base>[^[]+)(?P<extra>(\[.*)|$)/', 'foo[bar', $m)) { $segments = array($m['base']); echo 'found'."\n"; while (preg_match('/^\[(?P<segment>.*?)\](?P<extra>.*)$/', $m['extra'], $m)) { echo $m['segment']."\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 21
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 11
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 11
Branch analysis from position: 21
Branch analysis from position: 11
Branch analysis from position: 21
filename:       /in/LtYmP
function name:  (null)
number of ops:  22
compiled vars:  !0 = $m, !1 = $segments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'preg_match'
          1        SEND_VAL                                                 '%2F%5E%28%3FP%3Cbase%3E%5B%5E%5B%5D%2B%29%28%3FP%3Cextra%3E%28%5C%5B.%2A%29%7C%24%29%2F'
          2        SEND_VAL                                                 'foo%5Bbar'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                         $2      
          5      > JMPZ                                                     $2, ->21
    3     6    >   FETCH_DIM_R                                      ~3      !0, 'base'
          7        INIT_ARRAY                                       ~4      ~3
          8        ASSIGN                                                   !1, ~4
    4     9        ECHO                                                     'found%0A'
    5    10      > JMP                                                      ->14
    6    11    >   FETCH_DIM_R                                      ~6      !0, 'segment'
         12        CONCAT                                           ~7      ~6, '%0A'
         13        ECHO                                                     ~7
    5    14    >   INIT_FCALL                                               'preg_match'
         15        SEND_VAL                                                 '%2F%5E%5C%5B%28%3FP%3Csegment%3E.%2A%3F%29%5C%5D%28%3FP%3Cextra%3E.%2A%29%24%2F'
         16        FETCH_DIM_R                                      ~8      !0, 'extra'
         17        SEND_VAL                                                 ~8
         18        SEND_REF                                                 !0
         19        DO_ICALL                                         $9      
         20      > JMPNZ                                                    $9, ->11
   10    21    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.44 ms | 1395 KiB | 15 Q