3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array (0 => 'title=Addition Worksheet', 1 => 'operator=+', 2 => 'numOfQue=6', 3 => 'final_result=positive', 4 => 'marks=3', 5 => 'numOfQueSet=3', 6 => 'orientation=vertical', 7 => 'fnum=1', 8 => 'snum=1' ); $arr2=[]; foreach($arr as $val){ list($key, $value) = explode('=', $val); //echo "\n".$key.' = '.$value; $arr2[trim($key)] = trim($value); } print_r($arr2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/pCqKk
function name:  (null)
number of ops:  27
compiled vars:  !0 = $arr, !1 = $arr2, !2 = $val, !3 = $key, !4 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   12     2      > FE_RESET_R                                       $7      !0, ->22
          3    > > FE_FETCH_R                                               $7, !2, ->22
   13     4    >   INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '%3D'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $8      
          8        FETCH_LIST_R                                     $9      $8, 0
          9        ASSIGN                                                   !3, $9
         10        FETCH_LIST_R                                     $11     $8, 1
         11        ASSIGN                                                   !4, $11
         12        FREE                                                     $8
   15    13        INIT_FCALL                                               'trim'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $13     
         16        INIT_FCALL                                               'trim'
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                         $15     
         19        ASSIGN_DIM                                               !1, $13
         20        OP_DATA                                                  $15
   12    21      > JMP                                                      ->3
         22    >   FE_FREE                                                  $7
   17    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145 ms | 1012 KiB | 16 Q