3v4l.org

run code in 300+ PHP versions simultaneously
<?php $emptyit = new EmptyIterator; echo 'count($emptyit): ', count($emptyit), "\n"; // obj w/no properties not empty PHP5+ //echo '$emptyit->count(): ', $emptyit->count(), "\n"; $n=0; foreach ($emptyit as $e) { $n++; } echo $n;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/rh45A
function name:  (null)
number of ops:  15
compiled vars:  !0 = $emptyit, !1 = $n, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'EmptyIterator'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    3     3        ECHO                                                     'count%28%24emptyit%29%3A+'
          4        COUNT                                            ~6      !0
          5        ECHO                                                     ~6
          6        ECHO                                                     '%0A'
    5     7        ASSIGN                                                   !1, 0
    6     8      > FE_RESET_R                                       $8      !0, ->12
          9    > > FE_FETCH_R                                               $8, !2, ->12
    7    10    >   PRE_INC                                                  !1
    6    11      > JMP                                                      ->9
         12    >   FE_FREE                                                  $8
    9    13        ECHO                                                     !1
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.1 ms | 1384 KiB | 13 Q