3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c { public $prop; function __wakeup() { $this->prop = 'awake'; } } $c = new c; $c->prop = new stdclass; $a = [$c]; $a[] =& $c->prop; $s = serialize($a); var_dump($s); var_dump($a); $a2 = unserialize($s); var_dump($a2); $a2[0] = 'ref?'; var_dump($a2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BoHl8
function name:  (null)
number of ops:  36
compiled vars:  !0 = $c, !1 = $a, !2 = $s, !3 = $a2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $4      'c'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   11     3        NEW                                              $8      'stdclass'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0, 'prop'
          6        OP_DATA                                                  $8
   12     7        INIT_ARRAY                                       ~10     !0
          8        ASSIGN                                                   !1, ~10
   13     9        FETCH_OBJ_W                                      $13     !0, 'prop'
         10        MAKE_REF                                         $14     $13
         11        FETCH_DIM_W                                      $12     !1
         12        ASSIGN_REF                                               $12, $14
   15    13        INIT_FCALL                                               'serialize'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $16     
         16        ASSIGN                                                   !2, $16
   16    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   17    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
   18    23        INIT_FCALL                                               'unserialize'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $20     
         26        ASSIGN                                                   !3, $20
   19    27        INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                                 
   20    30        ASSIGN_DIM                                               !3, 0
         31        OP_DATA                                                  'ref%3F'
   21    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !3
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Class c:
Function __wakeup:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BoHl8
function name:  __wakeup
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN_OBJ                                               'prop'
          1        OP_DATA                                                  'awake'
    7     2      > RETURN                                                   null

End of function __wakeup

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.29 ms | 1396 KiB | 19 Q