fork(3) download
  1. <?php
  2.  
  3. $serialized = serialize(
  4. [
  5. 'one' => 1,
  6. 'two' => 'nice',
  7. 'three' => 'will be damaged'
  8. ]
  9. );
  10.  
  11. var_dump($serialized); // a:3:{s:3:"one";i:1;s:3:"two";s:4:"nice";s:5:"three";s:15:"will be damaged";}
  12.  
  13. var_dump(unserialize('a:3:{s:3:"one";i:1;s:3:"two";s:4:"nice";s:5:"tee";s:15:"will be damaged";}')); // please note 'tee'
  14.  
  15. var_dump(unserialize('a:3:{s:3:"one";i:1;s:3:"two";s:4:"nice";s:5:"three";s:')); // serialized string is truncated
  16.  
  17.  
Success #stdin #stdout #stderr 0s 82560KB
stdin
Standard input is empty
stdout
string(76) "a:3:{s:3:"one";i:1;s:3:"two";s:4:"nice";s:5:"three";s:15:"will be damaged";}"
bool(false)
bool(false)
stderr
PHP Notice:  unserialize(): Error at offset 50 of 74 bytes in /home/54RjBa/prog.php on line 13
PHP Notice:  unserialize(): Error at offset 52 of 54 bytes in /home/54RjBa/prog.php on line 15