3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface FooInterface { public function dump(self $baz); } class Foo implements FooInterface { public function dump(self $baz) { var_dump($baz); } } class Bar extends Foo { public function dump(Foo $baz) { parent::dump($baz); } } $foo = new Foo; $foo->dump($foo); //(new Bar)->dump(new Bar); //(new Bar)->dump(new Foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vdj5F
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'foo'
   16     1        DECLARE_CLASS                                            'bar', 'foo'
   26     2        NEW                                              $1      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   28     5        INIT_METHOD_CALL                                         !0, 'dump'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
   30     8      > RETURN                                                   1

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

End of function dump

End of class FooInterface.

Class Foo:
Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vdj5F
function name:  dump
number of ops:  5
compiled vars:  !0 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   13     4      > RETURN                                                   null

End of function dump

End of class Foo.

Class Bar:
Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vdj5F
function name:  dump
number of ops:  5
compiled vars:  !0 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        INIT_STATIC_METHOD_CALL                                  'dump'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   21     4      > RETURN                                                   null

End of function dump

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.53 ms | 1401 KiB | 15 Q