3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Collection extends ArrayObject { public function getIterator() { return new ArrayIterator($this); } } 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/62dX5
function name:  (null)
number of ops:  21
compiled vars:  !0 = $i, !1 = $collection, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'gc_enable'
          1        DO_ICALL                                                 
   12     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
   14     8    >   NEW                                              $6      'Collection'
          9        SEND_VAL_EX                                              <array>
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $6
   16    12      > FE_RESET_R                                       $9      !1, ->16
         13    > > FE_FETCH_R                                               $9, !2, ->16
   17    14    >   ECHO                                                     !2
   16    15      > JMP                                                      ->13
         16    >   FE_FREE                                                  $9
   20    17        UNSET_CV                                                 !1
   12    18      > JMP                                                      ->7
         19    >   FE_FREE                                                  $5
   21    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/62dX5
function name:  getIterator
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $0      'ArrayIterator'
          1        FETCH_THIS                                       $1      
          2        SEND_VAR_EX                                              $1
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $0
    7     5*     > RETURN                                                   null

End of function getiterator

End of class Collection.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.16 ms | 1396 KiB | 17 Q