3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ["m" => 0,"b" => 1, "k" => 2,"a" => 3]; echo current($arr); // what is current position next($arr); // move current position echo current($arr); // mwhat is current position $key = array_keys($arr)[0]; echo current($arr); // make sure the position has not changed echo $key;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bhoEZ
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arr, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'current'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ECHO                                                     $3
    5     5        INIT_FCALL                                               'next'
          6        SEND_REF                                                 !0
          7        DO_ICALL                                                 
    6     8        INIT_FCALL                                               'current'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        ECHO                                                     $5
    7    12        INIT_FCALL                                               'array_keys'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $6      
         15        FETCH_DIM_R                                      ~7      $6, 0
         16        ASSIGN                                                   !1, ~7
    8    17        INIT_FCALL                                               'current'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $9      
         20        ECHO                                                     $9
   10    21        ECHO                                                     !1
   11    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
284.23 ms | 1007 KiB | 16 Q