3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a = array(); public function __construct() { $this->a[] = new B(1); $this->a[] = new B(2); } } class B implements Serializable { public $b; public function __construct($c) { $this->b = new C($c); } public function serialize() { print_r("serialize"); print_r($this->b); return serialize(clone $this->b); } public function unserialize($data) { $this->b = unserialize($data); } } class C { public $c; public function __construct($c) { $this->c = $c; } } $a = unserialize(serialize(new A()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DI0v6
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'b'
   45     1        INIT_FCALL                                               'unserialize'
          2        INIT_FCALL                                               'serialize'
          3        NEW                                              $1      'A'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !0, $4
         10      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DI0v6
function name:  __construct
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'B'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        FETCH_OBJ_W                                      $0      'a'
          4        ASSIGN_DIM                                               $0
          5        OP_DATA                                                  $2
    9     6        NEW                                              $6      'B'
          7        SEND_VAL_EX                                              2
          8        DO_FCALL                                      0          
          9        FETCH_OBJ_W                                      $4      'a'
         10        ASSIGN_DIM                                               $4
         11        OP_DATA                                                  $6
   10    12      > RETURN                                                   null

End of function __construct

End of class A.

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

End of function __construct

Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DI0v6
function name:  serialize
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'print_r'
          1        SEND_VAL                                                 'serialize'
          2        DO_ICALL                                                 
   25     3        INIT_FCALL                                               'print_r'
          4        FETCH_OBJ_R                                      ~1      'b'
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                                 
   26     7        INIT_FCALL                                               'serialize'
          8        FETCH_OBJ_R                                      ~3      'b'
          9        CLONE                                            ~4      ~3
         10        SEND_VAL                                                 ~4
         11        DO_ICALL                                         $5      
         12      > RETURN                                                   $5
   27    13*     > RETURN                                                   null

End of function serialize

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

End of function unserialize

End of class B.

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

End of function __construct

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.51 ms | 1404 KiB | 19 Q