3v4l.org

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

Class A:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FDkjG
function name:  serialize
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'serialize'
          1        FETCH_OBJ_R                                      ~0      '_a'
          2        INIT_ARRAY                                       ~1      ~0, 'a'
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
    7     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/FDkjG
function name:  unserialize
number of ops:  8
compiled vars:  !0 = $s, !1 = $d, !2 = $_a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'unserialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   10     5        FETCH_DIM_R                                      ~5      !1, 'a'
          6        ASSIGN                                                   !2, ~5
   11     7      > RETURN                                                   null

End of function unserialize

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.71 ms | 1396 KiB | 19 Q