3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Shiter { public function foo(Shiter $shit); } class Bbk implements Shiter { public function foo(Shiter $shit): Shiter { return new self(); } } $bbk = new Bbk(); $result = $bbk->foo(new Bbk()); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OpP23
function name:  (null)
number of ops:  14
compiled vars:  !0 = $bbk, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'bbk'
   14     1        NEW                                              $2      'Bbk'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   16     4        INIT_METHOD_CALL                                         !0, 'foo'
          5        NEW                                              $5      'Bbk'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $5
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
   18    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

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

End of function foo

End of class Shiter.

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

End of function foo

End of class Bbk.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.04 ms | 1396 KiB | 15 Q