3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(array $data = array()) { if (!empty($data)) { foreach ($data as $key => $value) { var_dump($key); var_dump($value); } } } test(); test(['aa' => 'zzz']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0kMQf
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0          
   15     2        INIT_FCALL                                               'test'
          3        SEND_VAL                                                 <array>
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 15
filename:       /in/0kMQf
function name:  test
number of ops:  16
compiled vars:  !0 = $data, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      <array>
    6     1        ISSET_ISEMPTY_CV                                 ~3      !0
          2        BOOL_NOT                                         ~4      ~3
          3      > JMPZ                                                     ~4, ->15
    7     4    > > FE_RESET_R                                       $5      !0, ->14
          5    > > FE_FETCH_R                                       ~6      $5, !1, ->14
          6    >   ASSIGN                                                   !2, ~6
    8     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
    9    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
    7    13      > JMP                                                      ->5
         14    >   FE_FREE                                                  $5
   12    15    > > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.5 ms | 1397 KiB | 17 Q