3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=['cses_id'=>'54','ccc_id'=>'1157','csh_id'=>'206','css_id'=>'441,442','sai_id'=>'12213']; $count=0; $multi=array_map(function($v)use(&$count){$count=max($count,substr_count($v,',')); return explode(',',$v);},$array); ++$count; for($col=0; $col<$count; ++$col){ $temp=[]; foreach($multi as $key=>&$val){ $temp[$key]=(sizeof($val)>1?array_shift($val):current($val)); } $result[]=$temp; } var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 12
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 125) Position 1 = 14, Position 2 = 31
Branch analysis from position: 14
2 jumps found. (Code = 126) Position 1 = 15, Position 2 = 31
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 12
Branch analysis from position: 37
Branch analysis from position: 12
Branch analysis from position: 31
filename:       /in/f7Pkm
function name:  (null)
number of ops:  41
compiled vars:  !0 = $array, !1 = $count, !2 = $multi, !3 = $col, !4 = $temp, !5 = $val, !6 = $key, !7 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 0
    5     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                          ~10     [0]
          4        BIND_LEXICAL                                             ~10, !1
          5        SEND_VAL                                                 ~10
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $11     
          8        ASSIGN                                                   !2, $11
    6     9        PRE_INC                                                  !1
    7    10        ASSIGN                                                   !3, 0
         11      > JMP                                                      ->35
    8    12    >   ASSIGN                                                   !4, <array>
    9    13      > FE_RESET_RW                                      $16     !2, ->31
         14    > > FE_FETCH_RW                                      ~17     $16, !5, ->31
         15    >   ASSIGN                                                   !6, ~17
   10    16        COUNT                                            ~20     !5
         17        IS_SMALLER                                               1, ~20
         18      > JMPZ                                                     ~21, ->24
         19    >   INIT_FCALL                                               'array_shift'
         20        SEND_REF                                                 !5
         21        DO_ICALL                                         $22     
         22        QM_ASSIGN                                        ~23     $22
         23      > JMP                                                      ->28
         24    >   INIT_FCALL                                               'current'
         25        SEND_VAR                                                 !5
         26        DO_ICALL                                         $24     
         27        QM_ASSIGN                                        ~23     $24
         28    >   ASSIGN_DIM                                               !4, !6
         29        OP_DATA                                                  ~23
    9    30      > JMP                                                      ->14
         31    >   FE_FREE                                                  $16
   12    32        ASSIGN_DIM                                               !7
         33        OP_DATA                                                  !4
    7    34        PRE_INC                                                  !3
         35    >   IS_SMALLER                                               !3, !1
         36      > JMPNZ                                                    ~27, ->12
   14    37    >   INIT_FCALL                                               'var_export'
         38        SEND_VAR                                                 !7
         39        DO_ICALL                                                 
         40      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f7Pkm
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $v, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'max'
          3        SEND_VAR                                                 !1
          4        INIT_FCALL                                               'substr_count'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 '%2C'
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10        ASSIGN                                                   !1, $3
         11        INIT_FCALL                                               'explode'
         12        SEND_VAL                                                 '%2C'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $5      
         15      > RETURN                                                   $5
         16*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
288.82 ms | 1022 KiB | 20 Q