3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Baz { public function foo(string $param = null, int $bar); } class Foo { public function foo(string $param = null, int $bar) { var_dump($param, $bar); } } class Bar extends Foo implements Baz { public function foo(?string $param, int $bar) { parent::foo($param, $bar); } } (new Bar)->foo('a', 1); interface Qux { public function foo(?string $param, int $bar); } class Quux { public function foo(?string $param, int $bar) { var_dump($param, $bar); } } class Corge extends Quux implements Qux { public function foo(string $param = null, int $bar) { parent::foo($param, $bar); } } (new Corge)->foo('b', 2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/USkgi
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   DECLARE_CLASS                                            'bar', 'foo'
   24     1        NEW                                              $0      'Bar'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'foo'
          4        SEND_VAL_EX                                              'a'
          5        SEND_VAL_EX                                              1
          6        DO_FCALL                                      0          
   42     7        DECLARE_CLASS                                            'corge', 'quux'
   51     8        NEW                                              $3      'Corge'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $3, 'foo'
         11        SEND_VAL_EX                                              'b'
         12        SEND_VAL_EX                                              2
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

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

End of function foo

End of class Baz.

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

End of function foo

End of class Foo.

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

End of function foo

End of class Bar.

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

End of function foo

End of class Qux.

Class Quux:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/USkgi
function name:  foo
number of ops:  7
compiled vars:  !0 = $param, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   38     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                                 
   39     6      > RETURN                                                   null

End of function foo

End of class Quux.

Class Corge:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/USkgi
function name:  foo
number of ops:  7
compiled vars:  !0 = $param, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   46     2        INIT_STATIC_METHOD_CALL                                  'foo'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   47     6      > RETURN                                                   null

End of function foo

End of class Corge.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.35 ms | 1005 KiB | 14 Q