3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B extends A { function __construct(parent $foo) { var_dump(get_class($foo)); } } $a = new A; $b = new B($a); $b2 = new B($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PBBYI
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $b, !2 = $b2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $3      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   16     3        NEW                                              $6      'B'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
   17     7        NEW                                              $9      'B'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
         11      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PBBYI
function name:  __construct
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'var_dump'
          2        GET_CLASS                                        ~1      !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
   10     5      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.69 ms | 1399 KiB | 15 Q