3v4l.org

run code in 300+ 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 = 21
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/nncdn
function name:  (null)
number of ops:  26
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, ->21
          7    > > FE_FETCH_R                                               $7, !2, ->21
    6     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%3D%3E'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !3, $8
    7    13        INIT_FCALL                                               'trim'
         14        FETCH_DIM_R                                      ~10     !3, 0
         15        SEND_VAL                                                 ~10
         16        DO_ICALL                                         $11     
         17        FETCH_DIM_R                                      ~13     !3, 1
         18        ASSIGN_DIM                                               !1, $11
         19        OP_DATA                                                  ~13
    5    20      > JMP                                                      ->7
         21    >   FE_FREE                                                  $7
   10    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.25 ms | 1428 KiB | 16 Q