3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EmptyIterator extends Iterator implements Countable { /** No operation. * @return void */ function rewind() { // nothing to do } /** @return \c false */ function valid() { return false; } /** This function must not be called. It throws an exception upon access. * @throw Exception * @return void */ function current() { throw new Exception('Accessing the value of an EmptyIterator'); } /** This function must not be called. It throws an exception upon access. * @throw Exception * @return void */ function key() { throw new Exception('Accessing the key of an EmptyIterator'); } /** No operation. * @return void */ function next() { // nothing to do } /** * @return int */ function count() { return 0; } } $ei = new EmptyIterator; echo count($ei);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VDOpJ
function name:  (null)
number of ops:  7
compiled vars:  !0 = $ei
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'emptyiterator', 'iterator'
   56     1        NEW                                              $1      'EmptyIterator'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   57     4        COUNT                                            ~4      !0
          5        ECHO                                                     ~4
          6      > RETURN                                                   1

Class EmptyIterator:
Function rewind:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VDOpJ
function name:  rewind
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   null

End of function rewind

Function valid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VDOpJ
function name:  valid
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   <false>
   17     1*     > RETURN                                                   null

End of function valid

Function current:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/VDOpJ
function name:  current
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'Accessing+the+value+of+an+EmptyIterator'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
   26     4*     > RETURN                                                   null

End of function current

Function key:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/VDOpJ
function name:  key
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'Accessing+the+key+of+an+EmptyIterator'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
   35     4*     > RETURN                                                   null

End of function key

Function next:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VDOpJ
function name:  next
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E > > RETURN                                                   null

End of function next

Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VDOpJ
function name:  count
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E > > RETURN                                                   0
   51     1*     > RETURN                                                   null

End of function count

End of class EmptyIterator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.69 ms | 1399 KiB | 13 Q