3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['x', 'y', 'z']; function array_fetch(array $a) { $element = current($a); next($a); //echo $a; var_dump($a); return $element; } $a=array_fetch($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HjZt3
function name:  (null)
number of ops:  6
compiled vars:  !0 = $array, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'array_fetch'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
          5      > RETURN                                                   1

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

End of function array_fetch

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.1 ms | 1397 KiB | 20 Q