3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '[This is] is a [test] string, [eat] my [shorts].'; preg_match_all("/\[[^\]]*\]/", $text, $matches); var_dump($matches[0]); $text = '[This] is a [test] string, [eat] my [shorts].'; preg_match_all("/\[([^\]]*)\]/", $text, $matches); var_dump($matches[1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ih6rA
function name:  (null)
number of ops:  21
compiled vars:  !0 = $text, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5BThis+is%5D+is+a+%5Btest%5D+string%2C+%5Beat%5D+my+%5Bshorts%5D.'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5C%5B%5B%5E%5C%5D%5D%2A%5C%5D%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        INIT_FCALL                                               'var_dump'
          7        FETCH_DIM_R                                      ~4      !1, 0
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
    7    10        ASSIGN                                                   !0, '%5BThis%5D+is+a+%5Btest%5D+string%2C+%5Beat%5D+my+%5Bshorts%5D.'
    8    11        INIT_FCALL                                               'preg_match_all'
         12        SEND_VAL                                                 '%2F%5C%5B%28%5B%5E%5C%5D%5D%2A%29%5C%5D%2F'
         13        SEND_VAR                                                 !0
         14        SEND_REF                                                 !1
         15        DO_ICALL                                                 
    9    16        INIT_FCALL                                               'var_dump'
         17        FETCH_DIM_R                                      ~8      !1, 1
         18        SEND_VAL                                                 ~8
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.63 ms | 1386 KiB | 17 Q