3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A extends \ArrayObject { protected $foo; public function __construct() { $this->foo = 'bar'; } public function serialize() { unset($this->foo); $result = parent::serialize(); $this->foo = 'bar'; return $result; } } $a = new A(); $a->append('item1'); $a->append('item2'); $a->append('item3'); $b = new A(); echo 'Serialized string: ' . $a->serialize() . PHP_EOL; $b->unserialize($a->serialize()); var_dump($b); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v353G
function name:  (null)
number of ops:  29
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   NEW                                                  $2      'A'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   21     3        INIT_METHOD_CALL                                             !0, 'append'
          4        SEND_VAL_EX                                                  'item1'
          5        DO_FCALL                                          0          
   22     6        INIT_METHOD_CALL                                             !0, 'append'
          7        SEND_VAL_EX                                                  'item2'
          8        DO_FCALL                                          0          
   23     9        INIT_METHOD_CALL                                             !0, 'append'
         10        SEND_VAL_EX                                                  'item3'
         11        DO_FCALL                                          0          
   25    12        NEW                                                  $8      'A'
         13        DO_FCALL                                          0          
         14        ASSIGN                                                       !1, $8
   26    15        INIT_METHOD_CALL                                             !0, 'serialize'
         16        DO_FCALL                                          0  $11     
         17        CONCAT                                               ~12     'Serialized+string%3A+', $11
         18        CONCAT                                               ~13     ~12, '%0A'
         19        ECHO                                                         ~13
   27    20        INIT_METHOD_CALL                                             !1, 'unserialize'
         21        INIT_METHOD_CALL                                             !0, 'serialize'
         22        DO_FCALL                                          0  $14     
         23        SEND_VAR_NO_REF_EX                                           $14
         24        DO_FCALL                                          0          
   28    25        INIT_FCALL                                                   'var_dump'
         26        SEND_VAR                                                     !1
         27        DO_ICALL                                                     
   29    28      > RETURN                                                       1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v353G
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_OBJ                                                   'foo'
          1        OP_DATA                                                      'bar'
    9     2      > 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/v353G
function name:  serialize
number of ops:  8
compiled vars:  !0 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   UNSET_OBJ                                                    'foo'
   14     1        INIT_STATIC_METHOD_CALL                                      'serialize'
          2        DO_FCALL                                          0  $1      
          3        ASSIGN                                                       !0, $1
   15     4        ASSIGN_OBJ                                                   'foo'
          5        OP_DATA                                                      'bar'
   16     6      > RETURN                                                       !0
   17     7*     > RETURN                                                       null

End of function serialize

End of class A.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.26 ms | 2407 KiB | 14 Q