3v4l.org

run code in 500+ PHP versions simultaneously
<?php class B { public $value; function __construct($value){ $this->value = $value; } function __wakeup() { if($this->value instanceof C) $this->value = C::$instance; } } class C { static public $instance; } C::$instance = new C; $A = array( new B(C::$instance), new B(C::$instance), new B(C::$instance) ); var_dump($A); $A = unserialize(serialize($A)); var_dump($A);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jpqW8
function name:  (null)
number of ops:  37
compiled vars:  !0 = $A
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   NEW                                                  $2      'C'
          1        DO_FCALL                                          0          
          2        ASSIGN_STATIC_PROP                                           'instance', 'C'
          3        OP_DATA                                                      $2
   18     4        NEW                                                  $4      'B'
          5        CHECK_FUNC_ARG                                               
          6        FETCH_STATIC_PROP_FUNC_ARG       unknown             $5      'instance'
          7        SEND_FUNC_ARG                                                $5
          8        DO_FCALL                                          0          
          9        INIT_ARRAY                                           ~7      $4
         10        NEW                                                  $8      'B'
         11        CHECK_FUNC_ARG                                               
         12        FETCH_STATIC_PROP_FUNC_ARG       unknown             $9      'instance'
         13        SEND_FUNC_ARG                                                $9
         14        DO_FCALL                                          0          
         15        ADD_ARRAY_ELEMENT                                    ~7      $8
         16        NEW                                                  $11     'B'
         17        CHECK_FUNC_ARG                                               
         18        FETCH_STATIC_PROP_FUNC_ARG       unknown             $12     'instance'
         19        SEND_FUNC_ARG                                                $12
         20        DO_FCALL                                          0          
         21        ADD_ARRAY_ELEMENT                                    ~7      $11
         22        ASSIGN                                                       !0, ~7
   20    23        INIT_FCALL                                                   'var_dump'
         24        SEND_VAR                                                     !0
         25        DO_ICALL                                                     
   21    26        INIT_FCALL                                                   'unserialize'
         27        INIT_FCALL                                                   'serialize'
         28        SEND_VAR                                                     !0
         29        DO_ICALL                                             $16     
         30        SEND_VAR                                                     $16
         31        DO_ICALL                                             $17     
         32        ASSIGN                                                       !0, $17
   22    33        INIT_FCALL                                                   'var_dump'
         34        SEND_VAR                                                     !0
         35        DO_ICALL                                                     
         36      > RETURN                                                       1

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jpqW8
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        ASSIGN_OBJ                                                   'value'
          2        OP_DATA                                                      !0
          3      > RETURN                                                       null

End of function __construct

Function __wakeup:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/jpqW8
function name:  __wakeup
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                          ~0      'value'
          1        INSTANCEOF                                                   ~0, 'C'
          2      > JMPZ                                                         ~1, ->6
   10     3    >   FETCH_STATIC_PROP_R              unknown             ~3      'instance'
          4        ASSIGN_OBJ                                                   'value'
          5        OP_DATA                                                      ~3
   11     6    > > RETURN                                                       null

End of function __wakeup

End of class B.

Class C: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
214.76 ms | 2922 KiB | 16 Q