3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); abstract class InterfaceA { abstract function beMyself(): self; } class ClassA extends InterfaceA { function beMyself(): self { return $this; } } var_dump((new ClassA)->beMyself());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D549v
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'ClassA'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'beMyself'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class InterfaceA:
Function bemyself:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D549v
function name:  beMyself
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   VERIFY_RETURN_TYPE                                       
          1      > RETURN                                                   null

End of function bemyself

End of class InterfaceA.

Class ClassA:
Function bemyself:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D549v
function name:  beMyself
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_THIS                                       ~0      
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   15     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function bemyself

End of class ClassA.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
303.65 ms | 1395 KiB | 15 Q