3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $y = 'b'; public $foo; public $bar; public $x = "A"; } class B { public $baz; function __wakeup() { echo "Within wakeup\n"; var_dump($this->baz); echo "Done wakeup\n"; } } $a = new A(); $b = new B(); $a->foo = $b; $a->bar = "something"; $b->baz = $a; var_dump($a); $unserialized = unserialize(serialize([$a])); echo "After unserialize\n"; var_dump($unserialized);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6r8dM
function name:  (null)
number of ops:  28
compiled vars:  !0 = $a, !1 = $b, !2 = $unserialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $3      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   20     3        NEW                                              $6      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   23     6        ASSIGN_OBJ                                               !0, 'foo'
          7        OP_DATA                                                  !1
   24     8        ASSIGN_OBJ                                               !0, 'bar'
          9        OP_DATA                                                  'something'
   25    10        ASSIGN_OBJ                                               !1, 'baz'
         11        OP_DATA                                                  !0
   26    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
   27    15        INIT_FCALL                                               'unserialize'
         16        INIT_FCALL                                               'serialize'
         17        INIT_ARRAY                                       ~13     !0
         18        SEND_VAL                                                 ~13
         19        DO_ICALL                                         $14     
         20        SEND_VAR                                                 $14
         21        DO_ICALL                                         $15     
         22        ASSIGN                                                   !2, $15
   29    23        ECHO                                                     'After+unserialize%0A'
   30    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function __wakeup:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6r8dM
function name:  __wakeup
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'Within+wakeup%0A'
   15     1        INIT_FCALL                                               'var_dump'
          2        FETCH_OBJ_R                                      ~0      'baz'
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                                 
   16     5        ECHO                                                     'Done+wakeup%0A'
   17     6      > RETURN                                                   null

End of function __wakeup

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.81 ms | 1001 KiB | 16 Q