3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "div-item-0,4,maintype:menu| heading: Quick Link| isactive:1,0,0,div-item-1,4,maintype:text| heading:Image| isactive:1,4,0,div-item-2,4,maintype:social| heading:Social| isactive:1,8,0"; $array = preg_split('/((?:[^,]+,){4}[^,]+),\s*/', trim($string), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kqFbJ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'div-item-0%2C4%2Cmaintype%3Amenu%7C+heading%3A+Quick+Link%7C++isactive%3A1%2C0%2C0%2Cdiv-item-1%2C4%2Cmaintype%3Atext%7C+heading%3AImage%7C++isactive%3A1%2C4%2C0%2Cdiv-item-2%2C4%2Cmaintype%3Asocial%7C+heading%3ASocial%7C++isactive%3A1%2C8%2C0'
    5     1        INIT_FCALL                                               'preg_split'
          2        SEND_VAL                                                 '%2F%28%28%3F%3A%5B%5E%2C%5D%2B%2C%29%7B4%7D%5B%5E%2C%5D%2B%29%2C%5Cs%2A%2F'
          3        INIT_FCALL                                               'trim'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        SEND_VAL                                                 -1
          8        SEND_VAL                                                 3
          9        DO_ICALL                                         $4      
         10        ASSIGN                                                   !1, $4
    6    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
233.12 ms | 1006 KiB | 16 Q