3v4l.org

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

Function mess:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WlKSQ
function name:  mess
number of ops:  9
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'unserialize'
          2        INIT_FCALL                                               'serialize'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
    4     8*     > RETURN                                                   null

End of function mess

Class X:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WlKSQ
function name:  __invoke
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     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:
160.48 ms | 1403 KiB | 23 Q