You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ext/standard/tests/serialize/incomplete_class.phpt
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,8 @@
3
3
--FILE--
4
4
<?php
5
5
6
-
$d = serialize(new__PHP_Incomplete_Class);
6
+
$orig = unserialize('O:7:"Unknown":0:{}');
7
+
$d = serialize($orig);
7
8
$o = unserialize($d);
8
9
var_dump($o);
9
10
@@ -18,13 +19,15 @@ var_dump($o->test2);
18
19
echo"Done\n";
19
20
?>
20
21
--EXPECTF--
21
-
object(__PHP_Incomplete_Class)#%d (0) {
22
+
object(__PHP_Incomplete_Class)#%d (1) {
23
+
["__PHP_Incomplete_Class_Name"]=>
24
+
string(7) "Unknown"
22
25
}
23
-
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
26
+
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
24
27
25
-
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
28
+
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
26
29
NULL
27
30
28
-
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
31
+
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
Copy file name to clipboardExpand all lines: ext/standard/tests/serialize/serialization_objects_006.phpt
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,18 @@
2
2
Behaviour of incomplete class is preserved even when it was not created by unserialize().
3
3
--FILE--
4
4
<?php
5
-
$a = new__PHP_Incomplete_Class;
5
+
$a = unserialize('O:7:"Unknown":0:{}');
6
6
var_dump($a);
7
7
var_dump($a->p);
8
8
9
9
echo"Done";
10
10
?>
11
11
--EXPECTF--
12
-
object(__PHP_Incomplete_Class)#%d (0) {
12
+
object(__PHP_Incomplete_Class)#1 (1) {
13
+
["__PHP_Incomplete_Class_Name"]=>
14
+
string(7) "Unknown"
13
15
}
14
16
15
-
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
17
+
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
0 commit comments