3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arr($array) { var_dump(key($array)); var_dump(current($array)); } $a = array('a' => 1, 'b' => 2, 'c' => 3); arr($a); next($a); arr($a); var_dump(key($a)); var_dump(current($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j54Fs
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'arr'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   11     4        INIT_FCALL                                               'next'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                                 
   12     7        INIT_FCALL                                               'arr'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0          
   14    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'key'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                                 
   15    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'current'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $7      
         20        SEND_VAR                                                 $7
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function arr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j54Fs
function name:  arr
number of ops:  14
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'key'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
    5     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'current'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                                 
    6    13      > RETURN                                                   null

End of function arr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.19 ms | 1399 KiB | 23 Q