serialization_objects_008.phpt 783 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Bad unserialize_callback_func
  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. ini_set('unserialize_callback_func','Nonexistent');
  16. $o = unserialize('O:3:"FOO":0:{}');
  17. var_dump($o);
  18. echo "Done";
  19. ?>
  20. --EXPECTF--
  21. Warning: unserialize(): defined (Nonexistent) but not found in %s on line 14
  22. object(__PHP_Incomplete_Class)#%d (1) {
  23. ["__PHP_Incomplete_Class_Name"]=>
  24. string(3) "FOO"
  25. }
  26. Done