3v4l.org

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

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

End of function dump

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.32 ms | 1398 KiB | 21 Q