3v4l.org

run code in 500+ PHP versions simultaneously
<?php class P { private int $someProp = 0; public function setProp(int $value): void { $this->someProp = $value; } } class C extends P { private array $cache = []; private int $someOtherProp; public function __construct(int $value) { $this->someOtherProp = $value; } public function fillCache(): void { $this->cache[] = 'value'; } public function __serialize(): array { return [ 'someOtherProp' => $this->someOtherProp ]; } public function __unserialize(array $data): void { $this->someOtherProp = $data['someOtherProp']; $this->cache = []; } } $c = new C(7); $c->setProp(5); $c->fillCache(); var_dump($c); var_dump($s = serialize($c)); var_dump(unserialize($s));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qdkcs
function name:  (null)
number of ops:  26
compiled vars:  !0 = $c, !1 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   40     0  E >   NEW                                                  $2      'C'
          1        SEND_VAL_EX                                                  7
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   41     4        INIT_METHOD_CALL                                             !0, 'setProp'
          5        SEND_VAL_EX                                                  5
          6        DO_FCALL                                          0          
   42     7        INIT_METHOD_CALL                                             !0, 'fillCache'
          8        DO_FCALL                                          0          
   43     9        INIT_FCALL                                                   'var_dump'
         10        SEND_VAR                                                     !0
         11        DO_ICALL                                                     
   44    12        INIT_FCALL                                                   'var_dump'
         13        INIT_FCALL                                                   'serialize'
         14        SEND_VAR                                                     !0
         15        DO_ICALL                                             $8      
         16        ASSIGN                                               ~9      !1, $8
         17        SEND_VAL                                                     ~9
         18        DO_ICALL                                                     
   45    19        INIT_FCALL                                                   'var_dump'
         20        INIT_FCALL                                                   'unserialize'
         21        SEND_VAR                                                     !1
         22        DO_ICALL                                             $11     
         23        SEND_VAR                                                     $11
         24        DO_ICALL                                                     
         25      > RETURN                                                       1

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

End of function setprop

End of class P.

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

End of function __construct

Function fillcache:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qdkcs
function name:  fillCache
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   FETCH_OBJ_W                                          $0      'cache'
          1        ASSIGN_DIM                                                   $0
          2        OP_DATA                                                      'value'
   24     3      > RETURN                                                       null

End of function fillcache

Function __serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qdkcs
function name:  __serialize
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   29     0  E >   FETCH_OBJ_R                                          ~0      'someOtherProp'
          1        INIT_ARRAY                                           ~1      ~0, 'someOtherProp'
          2        VERIFY_RETURN_TYPE                                           ~1
          3      > RETURN                                                       ~1
   31     4*       VERIFY_RETURN_TYPE                                           
          5*     > 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/Qdkcs
function name:  __unserialize
number of ops:  7
compiled vars:  !0 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   RECV                                                 !0      
   35     1        FETCH_DIM_R                                          ~2      !0, 'someOtherProp'
          2        ASSIGN_OBJ                                                   'someOtherProp'
          3        OP_DATA                                                      ~2
   36     4        ASSIGN_OBJ                                                   'cache'
          5        OP_DATA                                                      <array>
   37     6      > RETURN                                                       null

End of function __unserialize

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

End of function setprop

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.59 ms | 485 KiB | 10 Q