Annotation of embedaddon/php/ext/standard/tests/serialize/serialization_objects_007.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Ensure __autoload is called twice if unserialize_callback_func is defined.
3: --FILE--
4: <?php
5: /* Prototype : proto string serialize(mixed variable)
6: * Description: Returns a string representation of variable (which can later be unserialized)
7: * Source code: ext/standard/var.c
8: * Alias to functions:
9: */
10: /* Prototype : proto mixed unserialize(string variable_representation)
11: * Description: Takes a string representation of variable and recreates it
12: * Source code: ext/standard/var.c
13: * Alias to functions:
14: */
15:
16: function __autoload($name) {
17: echo "in __autoload($name)\n";
18: }
19:
20: ini_set('unserialize_callback_func','check');
21:
22: function check($name) {
23: echo "in check($name)\n";
24: }
25:
26: $o = unserialize('O:3:"FOO":0:{}');
27:
28: var_dump($o);
29:
30: echo "Done";
31: ?>
32: --EXPECTF--
33: in __autoload(FOO)
34: in check(FOO)
35: in __autoload(FOO)
36:
37: Warning: unserialize(): Function check() hasn't defined the class it was called for in %s on line 23
38: object(__PHP_Incomplete_Class)#%d (1) {
39: ["__PHP_Incomplete_Class_Name"]=>
40: string(3) "FOO"
41: }
42: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>