3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foobar implements \Serializable { /** @return string */ public function serialize(): string { return serialize(new \DateTimeZone('Europe/Andorra')); } /** @param string $serialized */ public function unserialize($serialized) { var_dump($serialized); var_dump(unserialize($serialized)->getName()); } } (new Foobar())->unserialize((new Foobar())->serialize()); var_dump(unserialize(serialize(new Foobar())));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QEdfQ
function name:  (null)
number of ops:  22
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foobar'
   19     1        NEW                                              $0      'Foobar'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'unserialize'
          4        NEW                                              $2      'Foobar'
          5        DO_FCALL                                      0          
          6        INIT_METHOD_CALL                                         $2, 'serialize'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR_NO_REF_EX                                       $4
          9        DO_FCALL                                      0          
   20    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'unserialize'
         12        INIT_FCALL                                               'serialize'
         13        NEW                                              $6      'Foobar'
         14        DO_FCALL                                      0          
         15        SEND_VAR                                                 $6
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class Foobar:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QEdfQ
function name:  serialize
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'serialize'
          1        NEW                                              $0      'DateTimeZone'
          2        SEND_VAL_EX                                              'Europe%2FAndorra'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                         $2      
          6        VERIFY_RETURN_TYPE                                       $2
          7      > RETURN                                                   $2
    9     8*       VERIFY_RETURN_TYPE                                       
          9*     > 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/QEdfQ
function name:  unserialize
number of ops:  13
compiled vars:  !0 = $serialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   15     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'unserialize'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $2      
          8        INIT_METHOD_CALL                                         $2, 'getName'
          9        DO_FCALL                                      0  $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                                 
   16    12      > RETURN                                                   null

End of function unserialize

End of class Foobar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.34 ms | 1404 KiB | 19 Q