3v4l.org

run code in 300+ PHP versions simultaneously
<?php class UnSerializable implements Serializable { public function serialize() {} public function unserialize($serialized) {} } $unser = new UnSerializable(); $arr = [$unser]; $arr[] = &$arr[0]; $arr[] = 'endcap'; $arr[] = &$arr[2]; $data = serialize($arr); echo $data . PHP_EOL; $recovered = unserialize($data); var_export($recovered);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YD9fS
function name:  (null)
number of ops:  30
compiled vars:  !0 = $unser, !1 = $arr, !2 = $data, !3 = $recovered
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'unserializable'
    9     1        NEW                                              $4      'UnSerializable'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
   10     4        INIT_ARRAY                                       ~7      !0
          5        ASSIGN                                                   !1, ~7
   11     6        FETCH_DIM_W                                      $10     !1, 0
          7        MAKE_REF                                         $11     $10
          8        FETCH_DIM_W                                      $9      !1
          9        ASSIGN_REF                                               $9, $11
   12    10        ASSIGN_DIM                                               !1
         11        OP_DATA                                                  'endcap'
   13    12        FETCH_DIM_W                                      $15     !1, 2
         13        MAKE_REF                                         $16     $15
         14        FETCH_DIM_W                                      $14     !1
         15        ASSIGN_REF                                               $14, $16
   15    16        INIT_FCALL                                               'serialize'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $18     
         19        ASSIGN                                                   !2, $18
   16    20        CONCAT                                           ~20     !2, '%0A'
         21        ECHO                                                     ~20
   17    22        INIT_FCALL                                               'unserialize'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $21     
         25        ASSIGN                                                   !3, $21
   18    26        INIT_FCALL                                               'var_export'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Class UnSerializable:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YD9fS
function name:  serialize
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > 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/YD9fS
function name:  unserialize
number of ops:  2
compiled vars:  !0 = $serialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function unserialize

End of class UnSerializable.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.15 ms | 1396 KiB | 19 Q