3v4l.org

run code in 300+ PHP versions simultaneously
<?php class IteratorClass implements Iterator { public function __construct() { } public function key() { } public function current() { } function next() { } function valid() { } function rewind() { } } class DerivedClass extends IteratorClass { } class NonIterator { } function dump_iterateable($class) { $reflection = new ReflectionClass($class); var_dump($reflection->isIterateable()); } $classes = array("ArrayObject", "IteratorClass", "DerivedClass", "NonIterator"); foreach ($classes as $class) { echo "Is $class iterateable? "; dump_iterateable($class); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/maasG
function name:  (null)
number of ops:  15
compiled vars:  !0 = $classes, !1 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'iteratorclass'
   11     1        DECLARE_CLASS                                            'derivedclass', 'iteratorclass'
   19     2        ASSIGN                                                   !0, <array>
   21     3      > FE_RESET_R                                       $3      !0, ->13
          4    > > FE_FETCH_R                                               $3, !1, ->13
   22     5    >   ROPE_INIT                                     3  ~5      'Is+'
          6        ROPE_ADD                                      1  ~5      ~5, !1
          7        ROPE_END                                      2  ~4      ~5, '+iterateable%3F+'
          8        ECHO                                                     ~4
   23     9        INIT_FCALL                                               'dump_iterateable'
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0          
   21    12      > JMP                                                      ->4
         13    >   FE_FREE                                                  $3
   24    14      > RETURN                                                   1

Function dump_iterateable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/maasG
function name:  dump_iterateable
number of ops:  11
compiled vars:  !0 = $class, !1 = $reflection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        NEW                                              $2      'ReflectionClass'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $2
   16     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !1, 'isIterateable'
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
   17    10      > RETURN                                                   null

End of function dump_iterateable

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

End of function __construct

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

End of function key

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

End of function current

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

End of function next

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

End of function valid

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

End of function rewind

End of class IteratorClass.

Class DerivedClass: [no user functions]
Class NonIterator: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.47 ms | 1402 KiB | 16 Q