3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo extends IteratorIterator { function __construct( $items ) { if ( is_array( $items ) ) { $items = new ArrayIterator( $items ); } } function __debugInfo() { return [ "count" => iterator_count( $this ) ]; } } $a = new Foo( [ 1,2,3 ] ); var_dump( $a ); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tHteN
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Foo'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   19     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   20     7      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/tHteN
function name:  __construct
number of ops:  8
compiled vars:  !0 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~1, ->7
    8     3    >   NEW                                              $2      'ArrayIterator'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   10     7    > > RETURN                                                   null

End of function __construct

Function __debuginfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tHteN
function name:  __debugInfo
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'iterator_count'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4        INIT_ARRAY                                       ~2      $1, 'count'
          5      > RETURN                                                   ~2
   15     6*     > RETURN                                                   null

End of function __debuginfo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.11 ms | 1396 KiB | 17 Q