3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public $pub = 0; protected $prot = 1; private $priv = 2; } $obj = (object) (array) new MyClass(); $obj_vars = get_object_vars( $obj ); foreach ( $obj_vars as $name => $value ) { $obj->$name = $value; } print_r( $obj );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/ZLvSd
function name:  (null)
number of ops:  20
compiled vars:  !0 = $obj, !1 = $obj_vars, !2 = $value, !3 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $4      'MyClass'
          1        DO_FCALL                                      0          
          2        CAST                                          7  ~6      $4
          3        CAST                                          8  ~7      ~6
          4        ASSIGN                                                   !0, ~7
   10     5        INIT_FCALL                                               'get_object_vars'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !1, $9
   12     9      > FE_RESET_R                                       $11     !1, ->15
         10    > > FE_FETCH_R                                       ~12     $11, !2, ->15
         11    >   ASSIGN                                                   !3, ~12
   13    12        ASSIGN_OBJ                                               !0, !3
         13        OP_DATA                                                  !2
   12    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $11
   16    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.83 ms | 1460 KiB | 15 Q