3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "[1,1x,1x,1x][2,2x,2x,2x]"; $arr =""; preg_replace_callback('/\[(.*?)\]/', function($m) use (&$arr){ $arr[] = explode(',',preg_replace('/([\w]+)/', "[$1]", $m[1])); }, $str); print_r($arr); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sLGA8
function name:  (null)
number of ops:  16
compiled vars:  !0 = $str, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B1%2C1x%2C1x%2C1x%5D%5B2%2C2x%2C2x%2C2x%5D'
    4     1        ASSIGN                                                   !1, ''
    5     2        INIT_FCALL                                               'preg_replace_callback'
          3        SEND_VAL                                                 '%2F%5C%5B%28.%2A%3F%29%5C%5D%2F'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsLGA8%3A5%240'
          5        BIND_LEXICAL                                             ~4, !1
    7     6        SEND_VAL                                                 ~4
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
    8     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
    9    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FsLGA8%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sLGA8
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $m, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAL                                                 '%2F%28%5B%5Cw%5D%2B%29%2F'
          6        SEND_VAL                                                 '%5B%241%5D'
          7        FETCH_DIM_R                                      ~3      !0, 1
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                         $5      
         12        ASSIGN_DIM                                               !1
         13        OP_DATA                                                  $5
    7    14      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FsLGA8%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.13 ms | 1396 KiB | 23 Q