3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} class Bar { public function test(Foo $foo) { var_dump($foo); } } class Baz implements Bar { public function test($foo) { var_dump($foo); } } $f = new Foo(); $z = new Baz(); $z->test($f); $z->test(true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IIaWl
function name:  (null)
number of ops:  14
compiled vars:  !0 = $f, !1 = $z
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'baz'
    7     1        NEW                                              $2      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    8     4        NEW                                              $5      'Baz'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
    9     7        INIT_METHOD_CALL                                         !1, 'test'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   10    10        INIT_METHOD_CALL                                         !1, 'test'
         11        SEND_VAL_EX                                              <true>
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IIaWl
function name:  test
number of ops:  5
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function test

End of class Bar.

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

End of function test

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.99 ms | 1396 KiB | 15 Q