3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Test { public function check(Test $x); } interface TestStrict extends Test { public function checkStrict(TestStrict $x); } class Foo implements TestStrict { //ok, exact match public function checkStrict(TestStrict $x) {} //fail, but TestStrict > Test I.e. //if $x fullfills TestStrict, it 100% satisfy Test too. //so - why? public function check(TestStrict $x) {} }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/atOaH
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'teststrict'
   13     1        DECLARE_CLASS                                            'foo'
   22     2      > RETURN                                                   1

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

End of function check

End of class Test.

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

End of function checkstrict

End of class TestStrict.

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

End of function checkstrict

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

End of function check

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.52 ms | 1394 KiB | 13 Q