3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); class A { public function stuff(mixed $value): string { return __CLASS__; } } class B extends A { public function stuff($value): string { return __CLASS__; } } $b = new B(); echo $b->stuff('whatever');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lIW3B
function name:  (null)
number of ops:  8
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $1      'B'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   12     3        INIT_METHOD_CALL                                             !0, 'stuff'
          4        SEND_VAL_EX                                                  'whatever'
          5        DO_FCALL                                          0  $4      
          6        ECHO                                                         $4
          7      > RETURN                                                       1

Class A:
Function stuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lIW3B
function name:  stuff
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1      > RETURN                                                       'A'
          2*       VERIFY_RETURN_TYPE                                           
          3*     > RETURN                                                       null

End of function stuff

End of class A.

Class B:
Function stuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lIW3B
function name:  stuff
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
          1      > RETURN                                                       'B'
          2*       VERIFY_RETURN_TYPE                                           
          3*     > RETURN                                                       null

End of function stuff

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.44 ms | 483 KiB | 9 Q