3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public int $a; protected int $b; private int $c; public function __construct() { $this->a = 2; $this->b = 3; $this->c = 4; } } $foo = new Foo(); $arr = (array) $foo; $o = (object) $arr; // should emit a warning as protected properties are renamed print_r($foo); print_r($arr); print_r($o); $o->b = 10; // because this creates new property! print_r($o);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2pnIb
function name:  (null)
number of ops:  22
compiled vars:  !0 = $foo, !1 = $arr, !2 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   19     3        CAST                                          7  ~6      !0
          4        ASSIGN                                                   !1, ~6
   20     5        CAST                                          8  ~8      !1
          6        ASSIGN                                                   !2, ~8
   22     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   23    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
   24    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
   26    16        ASSIGN_OBJ                                               !2, 'b'
         17        OP_DATA                                                  10
   28    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2pnIb
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN_OBJ                                               'a'
          1        OP_DATA                                                  2
   12     2        ASSIGN_OBJ                                               'b'
          3        OP_DATA                                                  3
   13     4        ASSIGN_OBJ                                               'c'
          5        OP_DATA                                                  4
   14     6      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.54 ms | 1001 KiB | 14 Q