3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = [ 'fruit' => [], 'animals' => [], 'objects' => [] ]; $dataArray = [ 'fruit' => 'apple', 'animals' => ['dog', 'cat'], 'asd' => 'bla' ]; foreach ($list as $k => &$v) { if (isset($dataArray[$k])) { $v = (array)$dataArray[$k]; } } var_export($list);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/uimZH
function name:  (null)
number of ops:  16
compiled vars:  !0 = $list, !1 = $dataArray, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   14     2      > FE_RESET_RW                                      $6      !0, ->11
          3    > > FE_FETCH_RW                                      ~7      $6, !2, ->11
          4    >   ASSIGN                                                   !3, ~7
   15     5        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !3
          6      > JMPZ                                                     ~9, ->10
   16     7    >   FETCH_DIM_R                                      ~10     !1, !3
          8        CAST                                          7  ~11     ~10
          9        ASSIGN                                                   !2, ~11
   14    10    > > JMP                                                      ->3
         11    >   FE_FREE                                                  $6
   20    12        INIT_FCALL                                               'var_export'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
256.5 ms | 1004 KiB | 14 Q