3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Fruit {} class Banana extends Fruit {} class Lemon extends Fruit {} class Base { public function methodOne(Banana $x) {} public function methodTwo(array $x) {} } class OverrideNullable extends Base { public function methodOne(Banana $x = null) {} public function methodTwo(array $x = null) {} } class OverrideParent extends Base { public function methodOne(Fruit $x) {} } class OverrideWildcard extends Base { public function methodOne($x) {} public function methodTwo($x) {} } (new Base())->methodOne(new Banana()); (new Base())->methodTwo([]); (new OverrideNullable())->methodOne(); (new OverrideNullable())->methodTwo(); (new OverrideParent())->methodOne(new Lemon()); (new OverrideWildcard())->methodOne(''); (new OverrideWildcard())->methodTwo(''); echo "Output intentionally left blank." , PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F9QQE
function name:  (null)
number of ops:  40
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $0      'Base'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'methodOne'
          3        NEW                                              $2      'Banana'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $2
          6        DO_FCALL                                      0          
   31     7        NEW                                              $5      'Base'
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $5, 'methodTwo'
         10        SEND_VAL_EX                                              <array>
         11        DO_FCALL                                      0          
   33    12        NEW                                              $8      'OverrideNullable'
         13        DO_FCALL                                      0          
         14        INIT_METHOD_CALL                                         $8, 'methodOne'
         15        DO_FCALL                                      0          
   34    16        NEW                                              $11     'OverrideNullable'
         17        DO_FCALL                                      0          
         18        INIT_METHOD_CALL                                         $11, 'methodTwo'
         19        DO_FCALL                                      0          
   36    20        NEW                                              $14     'OverrideParent'
         21        DO_FCALL                                      0          
         22        INIT_METHOD_CALL                                         $14, 'methodOne'
         23        NEW                                              $16     'Lemon'
         24        DO_FCALL                                      0          
         25        SEND_VAR_NO_REF_EX                                       $16
         26        DO_FCALL                                      0          
   38    27        NEW                                              $19     'OverrideWildcard'
         28        DO_FCALL                                      0          
         29        INIT_METHOD_CALL                                         $19, 'methodOne'
         30        SEND_VAL_EX                                              ''
         31        DO_FCALL                                      0          
   39    32        NEW                                              $22     'OverrideWildcard'
         33        DO_FCALL                                      0          
         34        INIT_METHOD_CALL                                         $22, 'methodTwo'
         35        SEND_VAL_EX                                              ''
         36        DO_FCALL                                      0          
   41    37        ECHO                                                     'Output+intentionally+left+blank.'
         38        ECHO                                                     '%0A'
   42    39      > RETURN                                                   1

Class Fruit: [no user functions]
Class Banana: [no user functions]
Class Lemon: [no user functions]
Class Base:
Function methodone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F9QQE
function name:  methodOne
number of ops:  2
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function methodone

Function methodtwo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F9QQE
function name:  methodTwo
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 methodtwo

End of class Base.

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

End of function methodone

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

End of function methodtwo

End of class OverrideNullable.

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

End of function methodone

Function methodtwo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F9QQE
function name:  methodTwo
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 methodtwo

End of class OverrideParent.

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

End of function methodone

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

End of function methodtwo

End of class OverrideWildcard.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.35 ms | 1407 KiB | 13 Q