3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} class Bar { public function __construct(Foo $foo) {} } class Baz { private Bar $bar; public function __construct(private Foo $foo, ?Bar $bar = null) { $this->bar = $bar ?? new Bar($this->foo); } } new Baz(new Foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AIDLL
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'Baz'
          1        NEW                                              $1      'Foo'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $1
          4        DO_FCALL                                      0          
          5        FREE                                                     $0
          6      > RETURN                                                   1

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

End of function __construct

End of class Bar.

Class Baz:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AIDLL
function name:  __construct
number of ops:  14
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2        ASSIGN_OBJ                                               'foo'
          3        OP_DATA                                                  !0
   15     4        COALESCE                                         ~3      !1
          5        NEW                                              $4      'Bar'
          6        CHECK_FUNC_ARG                                           
          7        FETCH_OBJ_FUNC_ARG                               $5      'foo'
          8        SEND_FUNC_ARG                                            $5
          9        DO_FCALL                                      0          
         10        QM_ASSIGN                                        ~3      $4
         11        ASSIGN_OBJ                                               'bar'
         12        OP_DATA                                                  ~3
   16    13      > RETURN                                                   null

End of function __construct

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.75 ms | 1003 KiB | 13 Q