3v4l.org

run code in 300+ PHP versions simultaneously
<?php $o=new C1();/*this is OK, because C1 does not implement anything, it can be declared anywhere.*/ $o=new C2();/*this is NOT ok, because C2 implements something, it must be declared before being used.*/ class C1 /*implements nothing*/ { } class C2 implements Countable{ function count(){} }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LudAO
function name:  (null)
number of ops:  8
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $1      'C1'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    3     3        NEW                                              $4      'C2'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
    8     6        DECLARE_CLASS                                            'c2'
   10     7      > RETURN                                                   1

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

End of function count

End of class C2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.54 ms | 1447 KiB | 13 Q