3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string1 = "-val1(sec1)-"; $string2 = "-val2(sec2)-"; $string3 = "-val3(sec3)-"; $big_string = $string1 . $string2 . $string3; if (preg_match_all('/-([^(]+)\(([^)]+)\)-/', $big_string, $matches, PREG_SET_ORDER)) { $result = array_map(static fn($match) => array_slice($match, 1), $matches); print_r($result); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/2Etfk
function name:  (null)
number of ops:  23
compiled vars:  !0 = $string1, !1 = $string2, !2 = $string3, !3 = $big_string, !4 = $matches, !5 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '-val1%28sec1%29-'
    4     1        ASSIGN                                                   !1, '-val2%28sec2%29-'
    5     2        ASSIGN                                                   !2, '-val3%28sec3%29-'
    6     3        CONCAT                                           ~9      !0, !1
          4        CONCAT                                           ~10     ~9, !2
          5        ASSIGN                                                   !3, ~10
    8     6        INIT_FCALL                                               'preg_match_all'
          7        SEND_VAL                                                 '%2F-%28%5B%5E%28%5D%2B%29%5C%28%28%5B%5E%29%5D%2B%29%5C%29-%2F'
          8        SEND_VAR                                                 !3
          9        SEND_REF                                                 !4
         10        SEND_VAL                                                 2
         11        DO_ICALL                                         $12     
         12      > JMPZ                                                     $12, ->22
    9    13    >   INIT_FCALL                                               'array_map'
         14        DECLARE_LAMBDA_FUNCTION                          ~13     [0]
         15        SEND_VAL                                                 ~13
         16        SEND_VAR                                                 !4
         17        DO_ICALL                                         $14     
         18        ASSIGN                                                   !5, $14
   10    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !5
         21        DO_ICALL                                                 
   11    22    > > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Etfk
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'array_slice'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 1
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.81 ms | 1004 KiB | 17 Q