3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='Demo #1: (11 steps)[1] and Demo #2: (35 steps)[2]'; var_export(preg_match_all('~\(([^)]*)\)\[([^\]]*)]~',$string,$out,PREG_SET_ORDER)?$out:[]);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/teN5Q
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Demo+%231%3A+%2811+steps%29%5B1%5D+and+Demo+%232%3A+%2835+steps%29%5B2%5D'
    4     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%7E%5C%28%28%5B%5E%29%5D%2A%29%5C%29%5C%5B%28%5B%5E%5C%5D%5D%2A%29%5D%7E'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !1
          6        SEND_VAL                                                 2
          7        DO_ICALL                                         $3      
          8      > JMPZ                                                     $3, ->11
          9    >   QM_ASSIGN                                        ~4      !1
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~4      <array>
         12    >   SEND_VAL                                                 ~4
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.2 ms | 1000 KiB | 15 Q