3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { public $name; function __invoke() {} } class Wrapper { public $x; } $wrapper = new Wrapper; $wrapper->x = new X; $wrapper->x->name = 'THENAME'; $wrapper2 = new Wrapper; $wrapper2->x = $wrapper->x; var_dump(unserialize(serialize($wrapper))); var_dump(unserialize(serialize($wrapper2)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rtAn2
function name:  (null)
number of ops:  35
compiled vars:  !0 = $wrapper, !1 = $wrapper2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'Wrapper'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   12     3        NEW                                              $6      'X'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0, 'x'
          6        OP_DATA                                                  $6
   13     7        FETCH_OBJ_W                                      $8      !0, 'x'
          8        ASSIGN_OBJ                                               $8, 'name'
          9        OP_DATA                                                  'THENAME'
   14    10        NEW                                              $10     'Wrapper'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $10
   15    13        FETCH_OBJ_R                                      ~14     !0, 'x'
         14        ASSIGN_OBJ                                               !1, 'x'
         15        OP_DATA                                                  ~14
   16    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'unserialize'
         18        INIT_FCALL                                               'serialize'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $15     
         21        SEND_VAR                                                 $15
         22        DO_ICALL                                         $16     
         23        SEND_VAR                                                 $16
         24        DO_ICALL                                                 
   17    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL                                               'unserialize'
         27        INIT_FCALL                                               'serialize'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $18     
         30        SEND_VAR                                                 $18
         31        DO_ICALL                                         $19     
         32        SEND_VAR                                                 $19
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Class X:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rtAn2
function name:  __invoke
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   null

End of function __invoke

End of class X.

Class Wrapper: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.07 ms | 1396 KiB | 19 Q