3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B extends A {} class Handler { public function handle(A $a) { print get_class($a); } } class HandlerB extends Handler { public function handle($a) { print get_class($a); } } $handlerA = new Handler(); $handlerB = new HandlerB(); $handlerA->handle(new A()); $handlerB->handle(new B());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2VP0D
function name:  (null)
number of ops:  17
compiled vars:  !0 = $handlerA, !1 = $handlerB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'Handler'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        NEW                                              $5      'HandlerB'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   22     6        INIT_METHOD_CALL                                         !0, 'handle'
          7        NEW                                              $8      'A'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $8
         10        DO_FCALL                                      0          
   23    11        INIT_METHOD_CALL                                         !1, 'handle'
         12        NEW                                              $11     'B'
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $11
         15        DO_FCALL                                      0          
         16      > RETURN                                                   1

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

End of function handle

End of class Handler.

Class HandlerB:
Function handle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2VP0D
function name:  handle
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        GET_CLASS                                        ~1      !0
          2        ECHO                                                     ~1
   16     3      > RETURN                                                   null

End of function handle

End of class HandlerB.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.63 ms | 1386 KiB | 13 Q