fork download
  1. <?php
  2.  
  3. $raw = array(
  4. '\'Weck\'' => ' is \'good\'',
  5. 'And:' => '"something"',
  6. ',' => 'can be "good"',
  7. '~' => ' as well',
  8. 'But' => 'It turns out that if there\'s a ", \', :, or ; in any of the array values the serialization gets corrupted.',
  9. 'Seems' => 'not the problem',
  10. );
  11.  
  12. $input = serialize($raw);
  13.  
Success #stdin #stdout 0.02s 24400KB
stdin
Standard input is empty
stdout
Array
(
    ['Weck'] =>  is 'good'
    [And:] => "something"
    [,] => can be "good"
    [~] =>  as well
    [But] => It turns out that if there's a ", ', :, or ; in any of the array values the serialization gets corrupted.
    [Seems] => not the problem
)