/hphp/test/zend/bad/ext/spl/tests/unserialize.php
http://github.com/facebook/hiphop-php · PHP · 18 lines · 12 code · 2 blank · 4 comment · 0 complexity · 63d6681d3a57a6f184844554b338db04 MD5 · raw file
- <?php
- $types = array('SplDoublyLinkedList', 'SplObjectStorage', 'ArrayObject');
- foreach ($types as $type) {
- // serialize an empty new object
- $exp = serialize(new $type());
- // hack to instanciate an object without constructor
- $str = sprintf('C:%d:"%s":0:{}', strlen($type), $type);
- $obj = unserialize($str);
- var_dump($obj);
- // serialize result
- $out = serialize($obj);
- // both should match
- var_dump($exp === $out);
- }
- ?>
- ===DONE===