3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'the(crow)bar', 'foo()bar', 'handlebar()', '()foofighters', '(foobar)', '()', 'barfood', 'barf(oo', 'fooeybar)', ')foob(', ]; $result = []; foreach ($strings as $string) { $result[$string] = preg_match('~\(([^)]+)\)~', $string, $match) ? $match[1] : ''; } var_export($result);
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 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/dRYEI
function name:  (null)
number of ops:  22
compiled vars:  !0 = $strings, !1 = $result, !2 = $string, !3 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1        ASSIGN                                                   !1, <array>
   17     2      > FE_RESET_R                                       $6      !0, ->17
          3    > > FE_FETCH_R                                               $6, !2, ->17
   18     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%7E%5C%28%28%5B%5E%29%5D%2B%29%5C%29%7E'
          6        SEND_VAR                                                 !2
          7        SEND_REF                                                 !3
          8        DO_ICALL                                         $8      
          9      > JMPZ                                                     $8, ->13
         10    >   FETCH_DIM_R                                      ~9      !3, 1
         11        QM_ASSIGN                                        ~10     ~9
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~10     ''
         14    >   ASSIGN_DIM                                               !1, !2
         15        OP_DATA                                                  ~10
   17    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $6
   20    18        INIT_FCALL                                               'var_export'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.94 ms | 1003 KiB | 15 Q