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 ) { $name = trim( $name, "\0*" ); $obj->$name = $value; } print_r( $obj );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/WXASh
function name:  (null)
number of ops:  25
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, ->20
         10    > > FE_FETCH_R                                       ~12     $11, !2, ->20
         11    >   ASSIGN                                                   !3, ~12
   13    12        INIT_FCALL                                               'trim'
         13        SEND_VAR                                                 !3
         14        SEND_VAL                                                 '%00%2A'
         15        DO_ICALL                                         $14     
         16        ASSIGN                                                   !3, $14
   14    17        ASSIGN_OBJ                                               !0, !3
         18        OP_DATA                                                  !2
   12    19      > JMP                                                      ->10
         20    >   FE_FREE                                                  $11
   17    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.36 ms | 1461 KiB | 16 Q