1--TEST--
2(un)serializing __PHP_Incomplete_Class instance
3--FILE--
4<?php
5
6$d = serialize(new __PHP_Incomplete_Class);
7$o = unserialize($d);
8var_dump($o);
9
10try {
11    $o->test = "a";
12} catch (Error $e) {
13    echo $e->getMessage(), "\n";
14}
15var_dump($o->test);
16var_dump($o->test2);
17
18echo "Done\n";
19?>
20--EXPECTF--
21object(__PHP_Incomplete_Class)#%d (0) {
22}
23The script tried to modify a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
24
25Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
26NULL
27
28Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d
29NULL
30Done
31