3v4l.org

run code in 500+ PHP versions simultaneously
<?php $detail = "1=>Apple, 2=>Cheesecake, 3=>Banana"; $arr = []; foreach (explode(',', $detail) as $item){ $parts = explode('=>', $item); $arr[trim($parts[0])] = $parts[1]; } var_dump($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/nncdn
function name:  (null)
number of ops:  24
compiled vars:  !0 = $detail, !1 = $arr, !2 = $item, !3 = $parts
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '1%3D%3EApple%2C+2%3D%3ECheesecake%2C+3%3D%3EBanana'
    4     1        ASSIGN                                                       !1, <array>
    5     2        INIT_FCALL                                                   'explode'
          3        SEND_VAL                                                     '%2C'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $6      
          6      > FE_RESET_R                                           $7      $6, ->19
          7    > > FE_FETCH_R                                                   $7, !2, ->19
    6     8    >   INIT_FCALL                                                   'explode'
          9        SEND_VAL                                                     '%3D%3E'
         10        SEND_VAR                                                     !2
         11        DO_ICALL                                             $8      
         12        ASSIGN                                                       !3, $8
    7    13        FETCH_DIM_R                                          ~10     !3, 0
         14        FRAMELESS_ICALL_1                trim                ~11     ~10
         15        FETCH_DIM_R                                          ~13     !3, 1
         16        ASSIGN_DIM                                                   !1, ~11
         17        OP_DATA                                                      ~13
    5    18      > JMP                                                          ->7
         19    >   FE_FREE                                                      $7
   10    20        INIT_FCALL                                                   'var_dump'
         21        SEND_VAR                                                     !1
         22        DO_ICALL                                                     
         23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.79 ms | 2659 KiB | 15 Q