3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); class OriginalClass { public function adopt(string $name): string { return $name; } } class XClass extends OriginalClass { public function adopt($name): string { return (string)$name; } } print (new XClass())->adopt(1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y7Q4W
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   NEW                                                  $0      'XClass'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $0, 'adopt'
          3        SEND_VAL_EX                                                  1
          4        DO_FCALL                                          0  $2      
          5        ECHO                                                         $2
          6      > RETURN                                                       1

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

End of function adopt

End of class OriginalClass.

Class XClass:
Function adopt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y7Q4W
function name:  adopt
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
   16     1        CAST                                              6  ~1      !0
          2        VERIFY_RETURN_TYPE                                           ~1
          3      > RETURN                                                       ~1
   17     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function adopt

End of class XClass.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
603.63 ms | 3339 KiB | 13 Q