3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $a = 0; protected $b = true; public $c = 'hello'; } class Another extends Test { private $a = 1; protected $b = false; public $d ='wow'; } $obj = new Another(); $data = (array) $obj; $new = (object) $data; echo $new->c, $new->d, $new->b, $new->a; var_dump($data); var_dump($new);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aFbJW
function name:  (null)
number of ops:  22
compiled vars:  !0 = $obj, !1 = $data, !2 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $3      'Another'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   23     3        CAST                                          7  ~6      !0
          4        ASSIGN                                                   !1, ~6
   24     5        CAST                                          8  ~8      !1
          6        ASSIGN                                                   !2, ~8
   25     7        FETCH_OBJ_R                                      ~10     !2, 'c'
          8        ECHO                                                     ~10
          9        FETCH_OBJ_R                                      ~11     !2, 'd'
         10        ECHO                                                     ~11
         11        FETCH_OBJ_R                                      ~12     !2, 'b'
         12        ECHO                                                     ~12
         13        FETCH_OBJ_R                                      ~13     !2, 'a'
         14        ECHO                                                     ~13
   26    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   27    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class Test: [no user functions]
Class Another: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.38 ms | 1395 KiB | 15 Q