3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends \ReflectionClass implements \Serializable { public function serialize() { return serialize($this->name); } public function unserialize($serialized) { $this->__construct(unserialize($serialized)); } } $a = new A('stdClass'); $serialized = serialize($a); var_dump($serialized); $unserialized = unserialize($serialized); var_dump($unserialized);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uSOVe
function name:  (null)
number of ops:  20
compiled vars:  !0 = $a, !1 = $serialized, !2 = $unserialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a', 'reflectionclass'
   16     1        NEW                                              $3      'A'
          2        SEND_VAL_EX                                              'stdClass'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   18     5        INIT_FCALL                                               'serialize'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !1, $6
   20     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   22    12        INIT_FCALL                                               'unserialize'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !2, $9
   24    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class A:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uSOVe
function name:  serialize
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'serialize'
          1        FETCH_OBJ_R                                      ~0      'name'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
    8     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/uSOVe
function name:  unserialize
number of ops:  8
compiled vars:  !0 = $serialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_METHOD_CALL                                         '__construct'
          2        INIT_FCALL                                               'unserialize'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR_NO_REF_EX                                       $1
          6        DO_FCALL                                      0          
   13     7      > RETURN                                                   null

End of function unserialize

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.07 ms | 1396 KiB | 19 Q