3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keys = ['1', '6', 4, '8', 'f', 200, '-1']; $one = []; foreach ($keys as $k) { $one[$k] = 'set'; } $two = []; foreach ($keys as $k) { $two[(int)$k] = 'set'; } var_dump($one, $two);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 7
filename:       /in/8p7gj
function name:  (null)
number of ops:  21
compiled vars:  !0 = $keys, !1 = $one, !2 = $k, !3 = $two
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $6      !0, ->7
          3    > > FE_FETCH_R                                               $6, !2, ->7
    7     4    >   ASSIGN_DIM                                               !1, !2
          5        OP_DATA                                                  'set'
    6     6      > JMP                                                      ->3
          7    >   FE_FREE                                                  $6
   10     8        ASSIGN                                                   !3, <array>
   11     9      > FE_RESET_R                                       $9      !0, ->15
         10    > > FE_FETCH_R                                               $9, !2, ->15
   12    11    >   CAST                                          4  ~10     !2
         12        ASSIGN_DIM                                               !3, ~10
         13        OP_DATA                                                  'set'
   11    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $9
   15    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.3 ms | 1451 KiB | 14 Q