3v4l.org

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

Class Bar: [no user functions]
Class Baz: [no user functions]
Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SoOPU
function name:  __construct
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                        !0      <const ast>
          1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

Function dothing:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SoOPU
function name:  doThing
number of ops:  3
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV_INIT                                        !0      <const ast>
   12     1      > RETURN                                                   !0
   13     2*     > RETURN                                                   null

End of function dothing

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
208.12 ms | 1010 KiB | 14 Q