3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public ?string $prop = null; public function __construct(?string $prop = null) { $this->prop = $prop; } } class Bar extends Foo { public function __construct( public ?string $bar = null, ) {} } // Echoes nothing, but it works as expected. echo (new Bar())->prop;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c3JHc
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $0      'Bar'
          1        DO_FCALL                                      0          
          2        FETCH_OBJ_R                                      ~2      $0, 'prop'
          3        ECHO                                                     ~2
   22     4      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c3JHc
function name:  __construct
number of ops:  4
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                        !0      null
    9     1        ASSIGN_OBJ                                               'prop'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c3JHc
function name:  __construct
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV_INIT                                        !0      null
          1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
   17     3      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.64 ms | 994 KiB | 13 Q