3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooIterator extends FilterIterator { /** * {@inheritdoc} * @see FilterIterator::accept() */ public function accept() { $this->getInnerIterator()->current(); return true; } } for ($i = 0; $i < 100000; $i++) { $iterator = new FooIterator(new ArrayIterator([100,11])); foreach ($iterator as $f) { $f++; } } print "Done\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 2
Branch analysis from position: 17
Branch analysis from position: 2
Branch analysis from position: 13
filename:       /in/rRPmL
function name:  (null)
number of ops:  19
compiled vars:  !0 = $i, !1 = $iterator, !2 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->15
   17     2    >   NEW                                              $4      'FooIterator'
          3        NEW                                              $5      'ArrayIterator'
          4        SEND_VAL_EX                                              <array>
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $5
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $4
   18     9      > FE_RESET_R                                       $9      !1, ->13
         10    > > FE_FETCH_R                                               $9, !2, ->13
   19    11    >   PRE_INC                                                  !2
   18    12      > JMP                                                      ->10
         13    >   FE_FREE                                                  $9
   16    14        PRE_INC                                                  !0
         15    >   IS_SMALLER                                               !0, 100000
         16      > JMPNZ                                                    ~12, ->2
   23    17    >   ECHO                                                     'Done%0A'
         18      > RETURN                                                   1

Class FooIterator:
Function accept:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rRPmL
function name:  accept
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_METHOD_CALL                                         'getInnerIterator'
          1        DO_FCALL                                      0  $0      
          2        INIT_METHOD_CALL                                         $0, 'current'
          3        DO_FCALL                                      0          
   11     4      > RETURN                                                   <true>
   12     5*     > RETURN                                                   null

End of function accept

End of class FooIterator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.97 ms | 1395 KiB | 13 Q