bug71841.phpt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. Bug #71841 (EG(error_zval) is not handled well)
  3. --FILE--
  4. <?php
  5. $z = unserialize('O:1:"A":0:{}');
  6. try {
  7. var_dump($z->e.=0);
  8. } catch (Error $e) {
  9. echo $e->getMessage(), "\n";
  10. }
  11. try {
  12. var_dump(++$z->x);
  13. } catch (Error $e) {
  14. echo $e->getMessage(), "\n";
  15. }
  16. try {
  17. var_dump($z->y++);
  18. } catch (Error $e) {
  19. echo $e->getMessage(), "\n";
  20. }
  21. $y = array(PHP_INT_MAX => 0);
  22. try {
  23. var_dump($y[] .= 0);
  24. } catch (Error $e) {
  25. echo $e->getMessage(), "\n";
  26. }
  27. try {
  28. var_dump(++$y[]);
  29. } catch (Error $e) {
  30. echo $e->getMessage(), "\n";
  31. }
  32. try {
  33. var_dump($y[]++);
  34. } catch (Error $e) {
  35. echo $e->getMessage(), "\n";
  36. }
  37. ?>
  38. --EXPECT--
  39. The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
  40. The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
  41. The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
  42. Cannot add element to the array as the next element is already occupied
  43. Cannot add element to the array as the next element is already occupied
  44. Cannot add element to the array as the next element is already occupied