3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1=['0'=>'my key should be a (numeric) string']; $a2=[0=>'my key should be an int']; $a3= new stdClass; $a3->{"0"} = 'my key should be a (numeric) string'; $a3=(array)$a3; foreach($a1 as $key=>$val){echo $val.': ';var_dump($key);} foreach($a2 as $key=>$val){echo $val.': ';var_dump($key);} foreach($a3 as $key=>$val){echo $val.': ';var_dump($key);} var_dump($a1,$a2,$a3);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 38
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
Branch analysis from position: 28
Branch analysis from position: 18
filename:       /in/vQCck
function name:  (null)
number of ops:  45
compiled vars:  !0 = $a1, !1 = $a2, !2 = $a3, !3 = $val, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        NEW                                              $7      'stdClass'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $7
    6     5        ASSIGN_OBJ                                               !2, '0'
          6        OP_DATA                                                  'my+key+should+be+a+%28numeric%29+string'
    7     7        CAST                                          7  ~11     !2
          8        ASSIGN                                                   !2, ~11
    8     9      > FE_RESET_R                                       $13     !0, ->18
         10    > > FE_FETCH_R                                       ~14     $13, !3, ->18
         11    >   ASSIGN                                                   !4, ~14
         12        CONCAT                                           ~16     !3, '%3A+'
         13        ECHO                                                     ~16
         14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                                 
         17      > JMP                                                      ->10
         18    >   FE_FREE                                                  $13
    9    19      > FE_RESET_R                                       $18     !1, ->28
         20    > > FE_FETCH_R                                       ~19     $18, !3, ->28
         21    >   ASSIGN                                                   !4, ~19
         22        CONCAT                                           ~21     !3, '%3A+'
         23        ECHO                                                     ~21
         24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                                 
         27      > JMP                                                      ->20
         28    >   FE_FREE                                                  $18
   10    29      > FE_RESET_R                                       $23     !2, ->38
         30    > > FE_FETCH_R                                       ~24     $23, !3, ->38
         31    >   ASSIGN                                                   !4, ~24
         32        CONCAT                                           ~26     !3, '%3A+'
         33        ECHO                                                     ~26
         34        INIT_FCALL                                               'var_dump'
         35        SEND_VAR                                                 !4
         36        DO_ICALL                                                 
         37      > JMP                                                      ->30
         38    >   FE_FREE                                                  $23
   11    39        INIT_FCALL                                               'var_dump'
         40        SEND_VAR                                                 !0
         41        SEND_VAR                                                 !1
         42        SEND_VAR                                                 !2
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.39 ms | 1400 KiB | 15 Q