forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathincomplete_class.phpt
30 lines (25 loc) · 1.17 KB
/
incomplete_class.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--TEST--
(un)serializing __PHP_Incomplete_Class instance
--FILE--
<?php
$d = serialize(new __PHP_Incomplete_Class);
$o = unserialize($d);
var_dump($o);
try {
$o->test = "a";
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump($o->test);
var_dump($o->test2);
echo "Done\n";
?>
--EXPECTF--
object(__PHP_Incomplete_Class)#%d (0) {
}
The 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
Warning: 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
NULL
Warning: 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
NULL
Done