3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function f($traversable) { var_dump($traversable); foreach ($traversable as $k => $v) { var_dump($k, $v); } } $arr = ['zero', 'one']; f($arr); echo PHP_EOL; $obj = (object) $arr; f($obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ts42B
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'f'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   12     4        ECHO                                                     '%0A'
   13     5        CAST                                          8  ~4      !0
          6        ASSIGN                                                   !1, ~4
   14     7        INIT_FCALL                                               'f'
          8        SEND_VAR                                                 !1
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

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

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.39 ms | 1399 KiB | 17 Q