3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "Wheat Flour (2%) [Wheat Flour, Wheat Gluten, Calcium Carbonate, Iron, Niacin (B3), Thiamin (B1), Ascorbic Acid], Water, Yeast, Salt, Vegetable Oils (Palm, Rapeseed, oils (sunflower, rapeseed)), Soya Flour"; if (preg_match_all('~[^][(),\s][^][(),]*(?:\s*(?:(\[(?:[^][]++|(?1))*])|(\((?:[^()]++|(?2))*\))))*~', $text, $matches)) { print_r($matches[0]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/5Gs3J
function name:  (null)
number of ops:  12
compiled vars:  !0 = $text, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Wheat+Flour+%282%25%29+%5BWheat+Flour%2C+Wheat+Gluten%2C+Calcium+Carbonate%2C+Iron%2C+Niacin+%28B3%29%2C+Thiamin+%28B1%29%2C+Ascorbic+Acid%5D%2C+Water%2C+Yeast%2C+Salt%2C+Vegetable+Oils+%28Palm%2C+Rapeseed%2C+oils+%28sunflower%2C+rapeseed%29%29%2C+Soya+Flour'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%7E%5B%5E%5D%5B%28%29%2C%5Cs%5D%5B%5E%5D%5B%28%29%2C%5D%2A%28%3F%3A%5Cs%2A%28%3F%3A%28%5C%5B%28%3F%3A%5B%5E%5D%5B%5D%2B%2B%7C%28%3F1%29%29%2A%5D%29%7C%28%5C%28%28%3F%3A%5B%5E%28%29%5D%2B%2B%7C%28%3F2%29%29%2A%5C%29%29%29%29%2A%7E'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->11
    5     7    >   INIT_FCALL                                               'print_r'
          8        FETCH_DIM_R                                      ~4      !1, 0
          9        SEND_VAL                                                 ~4
         10        DO_ICALL                                                 
    6    11    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.4 ms | 1010 KiB | 15 Q