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 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/oHX05
function name:  (null)
number of ops:  20
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'
    4     7        ECHO                                                     '%24emptyit-%3Ecount%28%29%3A+'
          8        INIT_METHOD_CALL                                         !0, 'count'
          9        DO_FCALL                                      0  $7      
         10        ECHO                                                     $7
         11        ECHO                                                     '%0A'
    5    12        ASSIGN                                                   !1, 0
    6    13      > FE_RESET_R                                       $9      !0, ->17
         14    > > FE_FETCH_R                                               $9, !2, ->17
    7    15    >   PRE_INC                                                  !1
    6    16      > JMP                                                      ->14
         17    >   FE_FREE                                                  $9
    9    18        ECHO                                                     !1
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.67 ms | 1394 KiB | 13 Q