xref: /PHP-8.4/Zend/tests/bug64354.phpt (revision 858d0c09)
1--TEST--
2Bug #64354 (Unserialize array of objects whose class can't be autoloaded fail)
3--FILE--
4<?php
5class B implements Serializable {
6    public function serialize() {
7        throw new Exception("serialize");
8        return NULL;
9    }
10
11    public function unserialize($data) {
12    }
13}
14
15$data = array(new B);
16
17try {
18    serialize($data);
19} catch (Exception $e) {
20    var_dump($e->getMessage());
21}
22?>
23--EXPECTF--
24Deprecated: 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
25string(9) "serialize"
26