3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ "john.smith@domain.com:John", "jane.doe@domain.com:Jane" ]; function customArray($data){ $final = []; $i = 0; foreach($data as $k => $v){ $splitted = explode(":",$v); $final[$i]['user_email'] = $splitted[0]; $final[$i]['user_name'] = $splitted[1]; $i++; } return $final; } print_r(customArray($data));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lPeMS
function name:  (null)
number of ops:  8
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'customarray'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function customarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 21
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/lPeMS
function name:  customArray
number of ops:  24
compiled vars:  !0 = $data, !1 = $final, !2 = $i, !3 = $v, !4 = $k, !5 = $splitted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ASSIGN                                                   !1, <array>
   10     2        ASSIGN                                                   !2, 0
   11     3      > FE_RESET_R                                       $8      !0, ->21
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->21
          5    >   ASSIGN                                                   !4, ~9
   12     6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%3A'
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !5, $11
   13    11        FETCH_DIM_R                                      ~15     !5, 0
         12        FETCH_DIM_W                                      $13     !1, !2
         13        ASSIGN_DIM                                               $13, 'user_email'
         14        OP_DATA                                                  ~15
   14    15        FETCH_DIM_R                                      ~18     !5, 1
         16        FETCH_DIM_W                                      $16     !1, !2
         17        ASSIGN_DIM                                               $16, 'user_name'
         18        OP_DATA                                                  ~18
   15    19        PRE_INC                                                  !2
   11    20      > JMP                                                      ->4
         21    >   FE_FREE                                                  $8
   18    22      > RETURN                                                   !1
   19    23*     > RETURN                                                   null

End of function customarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.66 ms | 1009 KiB | 16 Q