3v4l.org

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

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

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.76 ms | 1010 KiB | 14 Q