3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f(Traversable $t) { foreach ($t as $k => $v) { echo "$k => $v\n"; } } $x = (object)['a','b','c']; f($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XJnNi
function name:  (null)
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   CAST                                          8  ~1      <array>
          1        ASSIGN                                                   !0, ~1
   10     2        INIT_FCALL                                               'f'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/XJnNi
function name:  f
number of ops:  12
compiled vars:  !0 = $t, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > FE_RESET_R                                       $3      !0, ->10
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->10
          3    >   ASSIGN                                                   !2, ~4
    5     4        ROPE_INIT                                     4  ~7      !2
          5        ROPE_ADD                                      1  ~7      ~7, '+%3D%3E+'
          6        ROPE_ADD                                      2  ~7      ~7, !1
          7        ROPE_END                                      3  ~6      ~7, '%0A'
          8        ECHO                                                     ~6
    4     9      > JMP                                                      ->2
         10    >   FE_FREE                                                  $3
    7    11      > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.39 ms | 998 KiB | 14 Q