Return to serialization_objects_009.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / serialize |
1.1 misho 1: --TEST-- 2: Custom unserialization of classes with no custom unserializer. 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: $ser = 'C:1:"C":6:{dasdas}'; 17: $a = unserialize($ser); 18: eval('class C {}'); 19: $b = unserialize($ser); 20: 21: var_dump($a, $b); 22: 23: echo "Done"; 24: ?> 25: --EXPECTF-- 26: Warning: Class __PHP_Incomplete_Class has no unserializer in %sserialization_objects_009.php on line %d 27: 28: Warning: Class C has no unserializer in %sserialization_objects_009.php on line %d 29: object(__PHP_Incomplete_Class)#%d (1) { 30: ["__PHP_Incomplete_Class_Name"]=> 31: string(1) "C" 32: } 33: object(C)#%d (0) { 34: } 35: Done