3v4l.org

run code in 500+ PHP versions simultaneously
<?php class obj implements Serializable { private $data; public function __construct() { $this->data = "My private data"; } public function serialize() { echo 'serialize' . PHP_EOL; return serialize($this->data); } public function unserialize($data) { echo 'unserialize' . PHP_EOL; $this->data = unserialize($data); } public function getData() { return $this->data; } } $obj = new obj; $ser = serialize($obj); var_dump($ser); $unser = unserialize($ser); echo($unser->getData());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tp4UF
function name:  (null)
number of ops:  19
compiled vars:  !0 = $obj, !1 = $ser, !2 = $unser
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'obj'
   25     1        NEW                                                  $3      'obj'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $3
   26     4        INIT_FCALL                                                   'serialize'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                             $6      
          7        ASSIGN                                                       !1, $6
   27     8        INIT_FCALL                                                   'var_dump'
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                                     
   29    11        INIT_FCALL                                                   'unserialize'
         12        SEND_VAR                                                     !1
         13        DO_ICALL                                             $9      
         14        ASSIGN                                                       !2, $9
   30    15        INIT_METHOD_CALL                                             !2, 'getData'
         16        DO_FCALL                                          0  $11     
         17        ECHO                                                         $11
         18      > RETURN                                                       1

Class obj:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tp4UF
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   ASSIGN_OBJ                                                   'data'
          1        OP_DATA                                                      'My+private+data'
    8     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/Tp4UF
function name:  serialize
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                         'serialize%0A'
   12     1        INIT_FCALL                                                   'serialize'
          2        FETCH_OBJ_R                                          ~0      'data'
          3        SEND_VAL                                                     ~0
          4        DO_ICALL                                             $1      
          5      > RETURN                                                       $1
   13     6*     > 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/Tp4UF
function name:  unserialize
number of ops:  8
compiled vars:  !0 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
   16     1        ECHO                                                         'unserialize%0A'
   17     2        INIT_FCALL                                                   'unserialize'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $2      
          5        ASSIGN_OBJ                                                   'data'
          6        OP_DATA                                                      $2
   18     7      > RETURN                                                       null

End of function unserialize

Function getdata:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tp4UF
function name:  getData
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                          ~0      'data'
          1      > RETURN                                                       ~0
   22     2*     > RETURN                                                       null

End of function getdata

End of class obj.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
203.8 ms | 1760 KiB | 16 Q