3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function doAbd(?int $abc = null) {} } class Bar extends foo { public function doAbd(int $abc = null) {} } $foo = new Foo(); $foo->doAbd(); $bar = new Bar(); $bar->doAbd(); echo "No LSP errors.";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VmME0
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   12     3        INIT_METHOD_CALL                                         !0, 'doAbd'
          4        DO_FCALL                                      0          
   14     5        NEW                                              $6      'Bar'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   15     8        INIT_METHOD_CALL                                         !1, 'doAbd'
          9        DO_FCALL                                      0          
   17    10        ECHO                                                     'No+LSP+errors.'
         11      > RETURN                                                   1

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

End of function doabd

End of class Foo.

Class Bar:
Function doabd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VmME0
function name:  doAbd
number of ops:  2
compiled vars:  !0 = $abc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV_INIT                                        !0      null
          1      > RETURN                                                   null

End of function doabd

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.46 ms | 1010 KiB | 13 Q