bug64354.phpt 644 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #64354 (Unserialize array of objects whose class can't be autoloaded fail)
  3. --FILE--
  4. <?php
  5. class B implements Serializable {
  6. public function serialize() {
  7. throw new Exception("serialize");
  8. return NULL;
  9. }
  10. public function unserialize($data) {
  11. }
  12. }
  13. $data = array(new B);
  14. try {
  15. serialize($data);
  16. } catch (Exception $e) {
  17. var_dump($e->getMessage());
  18. }
  19. ?>
  20. --EXPECTF--
  21. Deprecated: B implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
  22. string(9) "serialize"