3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Pinq\Iterators\Standard; /** * Common functionality for the array iterator * * @author Elliot Levin <elliotlevin@hotmail.com> */ trait ArrayIteratorT { /** * @var array */ protected $array; public function __constructIterator(array &$array) { $this->array =& $array; } /** * @return array */ final public function getArrayCopy() { return $this->array; } } /** * Implementation of the array iterator using the fetch method. * * @author Elliot Levin <elliotlevin@hotmail.com> */ class ArrayIterator { use ArrayIteratorT; public function __construct(array $array) { self::__constructIterator($array); } public function doRewind() { reset($this->array); } final protected function doFetch() { $key = key($this->array); if ($key === null) { return null; } next($this->array); return [$key, &$this->array[$key]]; } } (new ArrayIterator([]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Shjrf
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   DECLARE_CLASS                                            'pinq%5Citerators%5Cstandard%5Carrayiterator'
   56     1        NEW                                              $0      'Pinq%5CIterators%5CStandard%5CArrayIterator'
          2        SEND_VAL_EX                                              <array>
          3        DO_FCALL                                      0          
          4        FREE                                                     $0
          5      > RETURN                                                   1

Class Pinq\Iterators\Standard\ArrayIteratorT:
Function __constructiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Shjrf
function name:  __constructIterator
number of ops:  4
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        ASSIGN_OBJ_REF                                           'array'
          2        OP_DATA                                                  !0
   19     3      > RETURN                                                   null

End of function __constructiterator

Function getarraycopy:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Shjrf
function name:  getArrayCopy
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'array'
          1      > RETURN                                                   ~0
   26     2*     > RETURN                                                   null

End of function getarraycopy

End of class Pinq\Iterators\Standard\ArrayIteratorT.

Class Pinq\Iterators\Standard\ArrayIterator:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Shjrf
function name:  __construct
number of ops:  5
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
   39     1        INIT_STATIC_METHOD_CALL                                  '__constructIterator'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   40     4      > RETURN                                                   null

End of function __construct

Function dorewind:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Shjrf
function name:  doRewind
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   INIT_NS_FCALL_BY_NAME                                    'Pinq%5CIterators%5CStandard%5Creset'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $0      'array'
          3        SEND_FUNC_ARG                                            $0
          4        DO_FCALL                                      0          
   44     5      > RETURN                                                   null

End of function dorewind

Function dofetch:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Shjrf
function name:  doFetch
number of ops:  20
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   INIT_NS_FCALL_BY_NAME                                    'Pinq%5CIterators%5CStandard%5Ckey'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $1      'array'
          3        SEND_FUNC_ARG                                            $1
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !0, $2
   48     6        TYPE_CHECK                                    2          !0
          7      > JMPZ                                                     ~4, ->9
   49     8    > > RETURN                                                   null
   51     9    >   INIT_NS_FCALL_BY_NAME                                    'Pinq%5CIterators%5CStandard%5Cnext'
         10        CHECK_FUNC_ARG                                           
         11        FETCH_OBJ_FUNC_ARG                               $5      'array'
         12        SEND_FUNC_ARG                                            $5
         13        DO_FCALL                                      0          
   52    14        INIT_ARRAY                                       ~7      !0
         15        FETCH_OBJ_W                                      $8      'array'
         16        FETCH_DIM_W                                      $9      $8, !0
         17        ADD_ARRAY_ELEMENT                                ~7      $9
         18      > RETURN                                                   ~7
   53    19*     > RETURN                                                   null

End of function dofetch

End of class Pinq\Iterators\Standard\ArrayIterator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.69 ms | 1404 KiB | 20 Q