3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { readonly string $bar; public function __construct( readonly int $promotedProp ) { $this->bar = 'bar'; var_dump($this->promotedProp, $this->bar); } } new Foo(10);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nli62
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   NEW                                                  $0      'Foo'
          1        SEND_VAL_EX                                                  10
          2        DO_FCALL                                          0          
          3        FREE                                                         $0
          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/nli62
function name:  __construct
number of ops:  12
compiled vars:  !0 = $promotedProp
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        ASSIGN_OBJ                                                   'promotedProp'
          2        OP_DATA                                                      !0
   10     3        ASSIGN_OBJ                                                   'bar'
          4        OP_DATA                                                      'bar'
   11     5        INIT_FCALL                                                   'var_dump'
          6        FETCH_OBJ_R                                          ~2      'promotedProp'
          7        SEND_VAL                                                     ~2
          8        FETCH_OBJ_R                                          ~3      'bar'
          9        SEND_VAL                                                     ~3
         10        DO_ICALL                                                     
   12    11      > RETURN                                                       null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.98 ms | 1566 KiB | 14 Q