3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public readonly string $foo; } class B extends A { public function __construct( public readonly string $foo, ) { } } $bar = new B('dinky'); echo $bar->foo;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5NP9S
function name:  (null)
number of ops:  7
compiled vars:  !0 = $bar
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $1      'B'
          1        SEND_VAL_EX                                                  'dinky'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   15     4        FETCH_OBJ_R                                          ~4      !0, 'foo'
          5        ECHO                                                         ~4
   16     6      > RETURN                                                       1

Class A: [no user functions]
Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5NP9S
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
          1        ASSIGN_OBJ                                                   'foo'
          2        OP_DATA                                                      !0
   11     3      > RETURN                                                       null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
144.83 ms | 482 KiB | 9 Q