3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[text] (more text) (text...) [text!] (last text)"; preg_match_all('/[\[\(](.*?)[\]\)]/', $text, $matches, PREG_SET_ORDER, 0); $texts = array_column($matches, 1); var_dump($texts);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uCHIB
function name:  (null)
number of ops:  17
compiled vars:  !0 = $text, !1 = $matches, !2 = $texts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Btext%5D%0A%28more+text%29%0A%28text...%29%0A%5Btext%21%5D%0A%28last+text%29'
    9     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5B%5C%5B%5C%28%5D%28.%2A%3F%29%5B%5C%5D%5C%29%5D%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 2
          6        SEND_VAL                                                 0
          7        DO_ICALL                                                 
   11     8        INIT_FCALL                                               'array_column'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !2, $5
   12    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.49 ms | 1399 KiB | 19 Q