3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = <<<REGEX / #starting pattern delimiter (?> #starting atomic group, intended for performance ( #capture group 1 \[ #literal opening square brace (?: #non-capturing group for logic encapsulation (?> #starting atomic group, intended for performance [^[\]]+ #negate character class to match one or more non-square brace characters ) #closing atomic group | #or (?1) #recurse the subpattern contained within the first capture group )* #close non-capturing group and allow it to be repeated zero or more times \] #literal closing square brace ) #close capture group 1 | #or [^,[\]]+ #negate character class to match one or more non-square brace characters and non-commas )+ #close atomic group and require one or more matches of internal logic \K #forget previously matched characters to prevent losing them during splitting ,? #optionally match a comma /x REGEX; /* (cannot comment after pattern end) x modifier enables inline regex commenting */ var_export( preg_split( $regex, /* '/(?>(\[(?:(?>[^[\]]+)|(?1))*\])|[^,[\]]+)+\K,?/', */ "first,second[,b],third[a,b[1,2,3]],fourth[a[1,2]],sixth", 0, PREG_SPLIT_NO_EMPTY ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R9k4o
function name:  (null)
number of ops:  11
compiled vars:  !0 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F+++++++++++++++++++++%23starting+pattern+delimiter%0A+%28%3F%3E++++++++++++++++++%23starting+atomic+group%2C+intended+for+performance%0A++++%28+++++++++++++++++%23capture+group+1%0A+++++%5C%5B+++++++++++++++%23literal+opening+square+brace%0A+++++%28%3F%3A++++++++++++++%23non-capturing+group+for+logic+encapsulation%0A++++++++%28%3F%3E+++++++++++%23starting+atomic+group%2C+intended+for+performance%0A+++++++++++%5B%5E%5B%5C%5D%5D%2B++++%23negate+character+class+to+match+one+or+more+non-square+brace+characters%0A++++++++%29+++++++++++++%23closing+atomic+group%0A++++++++%7C+++++++++++++%23or%0A++++++++%28%3F1%29++++++++++%23recurse+the+subpattern+contained+within+the+first+capture+group%0A+++++%29%2A+++++++++++++++%23close+non-capturing+group+and+allow+it+to+be+repeated+zero+or+more+times%0A+++++%5C%5D+++++++++++++++%23literal+closing+square+brace%0A++++%29+++++++++++++++++%23close+capture+group+1%0A++++%7C+++++++++++++++++%23or%0A++++%5B%5E%2C%5B%5C%5D%5D%2B++++++++++%23negate+character+class+to+match+one+or+more+non-square+brace+characters+and+non-commas%0A+%29%2B+++++++++++++++++++%23close+atomic+group+and+require+one+or+more+matches+of+internal+logic%0A+%5CK+++++++++++++++++++%23forget+previously+matched+characters+to+prevent+losing+them+during+splitting%0A+%2C%3F+++++++++++++++++++%23optionally+match+a+comma%0A%2Fx'
   25     1        INIT_FCALL                                               'var_export'
   26     2        INIT_FCALL                                               'preg_split'
   27     3        SEND_VAR                                                 !0
   28     4        SEND_VAL                                                 'first%2Csecond%5B%2Cb%5D%2Cthird%5Ba%2Cb%5B1%2C2%2C3%5D%5D%2Cfourth%5Ba%5B1%2C2%5D%5D%2Csixth'
   29     5        SEND_VAL                                                 0
   30     6        SEND_VAL                                                 1
   26     7        DO_ICALL                                         $2      
   30     8        SEND_VAR                                                 $2
   25     9        DO_ICALL                                                 
   32    10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.21 ms | 1011 KiB | 15 Q