3v4l.org

run code in 500+ PHP versions simultaneously
<?php $keys = array("step1","step2"); $tests = array( "native_array" => array_fill_keys($keys, array()), "object" => array_fill_keys($keys, new ArrayObject()) ); foreach($tests as $testName => $aData) { foreach($aData as $k => &$v) { $v["loops"][] = $k; # $aData[$k]["loops2"][] = $k; } echo "Results for ".$testName."\n"; print_r($aData); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 32
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 32
Branch analysis from position: 16
2 jumps found. (Code = 125) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
2 jumps found. (Code = 126) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 24
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/TpP3N
function name:  (null)
number of ops:  34
compiled vars:  !0 = $keys, !1 = $tests, !2 = $aData, !3 = $testName, !4 = $v, !5 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    7     1        INIT_FCALL                                                   'array_fill_keys'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     <array>
          4        DO_ICALL                                             $7      
          5        INIT_ARRAY                                           ~8      $7, 'native_array'
    8     6        INIT_FCALL                                                   'array_fill_keys'
          7        SEND_VAR                                                     !0
          8        NEW                                                  $9      'ArrayObject'
          9        DO_FCALL                                          0          
         10        SEND_VAR                                                     $9
         11        DO_ICALL                                             $11     
         12        ADD_ARRAY_ELEMENT                                    ~8      $11, 'object'
    6    13        ASSIGN                                                       !1, ~8
   12    14      > FE_RESET_R                                           $13     !1, ->32
         15    > > FE_FETCH_R                                           ~14     $13, !2, ->32
         16    >   ASSIGN                                                       !3, ~14
   13    17      > FE_RESET_RW                                          $16     !2, ->24
         18    > > FE_FETCH_RW                                          ~17     $16, !4, ->24
         19    >   ASSIGN                                                       !5, ~17
   14    20        FETCH_DIM_W                                          $19     !4, 'loops'
         21        ASSIGN_DIM                                                   $19
         22        OP_DATA                                                      !5
   13    23      > JMP                                                          ->18
         24    >   FE_FREE                                                      $16
   18    25        CONCAT                                               ~21     'Results+for+', !3
         26        CONCAT                                               ~22     ~21, '%0A'
         27        ECHO                                                         ~22
   19    28        INIT_FCALL                                                   'print_r'
         29        SEND_VAR                                                     !2
         30        DO_ICALL                                                     
   12    31      > JMP                                                          ->15
         32    >   FE_FREE                                                      $13
   20    33      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.4 ms | 484 KiB | 9 Q