3v4l.org

run code in 500+ PHP versions simultaneously
<?php Interface I{ public static function init(?string $url): self; } class C implements I{ public static function init(?string $url): self{ return new self(); } } $o = C::init("foo"); var_dump($o);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VYbGn
function name:  (null)
number of ops:  9
compiled vars:  !0 = $o
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                                'c'
   10     1        INIT_STATIC_METHOD_CALL                                      'C', 'init'
          2        SEND_VAL_EX                                                  'foo'
          3        DO_FCALL                                          0  $1      
          4        ASSIGN                                                       !0, $1
   11     5        INIT_FCALL                                                   'var_dump'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                                     
          8      > RETURN                                                       1

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

End of function init

End of class I.

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

End of function init

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.52 ms | 2004 KiB | 14 Q