incomplete_class.phpt 1.2 KB

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. (un)serializing __PHP_Incomplete_Class instance
  3. --FILE--
  4. <?php
  5. $d = serialize(new __PHP_Incomplete_Class);
  6. $o = unserialize($d);
  7. var_dump($o);
  8. try {
  9. $o->test = "a";
  10. } catch (Error $e) {
  11. echo $e->getMessage(), "\n";
  12. }
  13. var_dump($o->test);
  14. var_dump($o->test2);
  15. echo "Done\n";
  16. ?>
  17. --EXPECTF--
  18. object(__PHP_Incomplete_Class)#%d (0) {
  19. }
  20. 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
  21. 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
  22. NULL
  23. 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
  24. NULL
  25. Done