3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Collection extends ArrayObject { protected $iterator; public function getIterator() { $this->iterator = new ArrayIterator($this); return $this->iterator; } } gc_enable(); foreach (range(1, 5000000) as $i) { $collection = new Collection([ 'foo', 'bar' ]); foreach ($collection as $item) { echo $item; } unset($collection); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/OR7bK
function name:  (null)
number of ops:  21
compiled vars:  !0 = $i, !1 = $collection, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'gc_enable'
          1        DO_ICALL                                                 
   14     2        INIT_FCALL                                               'range'
          3        SEND_VAL                                                 1
          4        SEND_VAL                                                 5000000
          5        DO_ICALL                                         $4      
          6      > FE_RESET_R                                       $5      $4, ->19
          7    > > FE_FETCH_R                                               $5, !0, ->19
   16     8    >   NEW                                              $6      'Collection'
          9        SEND_VAL_EX                                              <array>
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $6
   18    12      > FE_RESET_R                                       $9      !1, ->16
         13    > > FE_FETCH_R                                               $9, !2, ->16
   19    14    >   ECHO                                                     !2
   18    15      > JMP                                                      ->13
         16    >   FE_FREE                                                  $9
   22    17        UNSET_CV                                                 !1
   14    18      > JMP                                                      ->7
         19    >   FE_FREE                                                  $5
   23    20      > RETURN                                                   1

Class Collection:
Function getiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OR7bK
function name:  getIterator
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'ArrayIterator'
          1        FETCH_THIS                                       $2      
          2        SEND_VAR_EX                                              $2
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'iterator'
          5        OP_DATA                                                  $1
    8     6        FETCH_OBJ_R                                      ~4      'iterator'
          7      > RETURN                                                   ~4
    9     8*     > RETURN                                                   null

End of function getiterator

End of class Collection.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.26 ms | 1388 KiB | 17 Q