bug67539.phpt 437 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #67539 (ArrayIterator use-after-free due to object change during sorting)
  3. --FILE--
  4. <?php
  5. $it = new ArrayIterator(array_fill(0,2,'X'), 1 );
  6. function badsort($a, $b) {
  7. try {
  8. $GLOBALS['it']->unserialize($GLOBALS['it']->serialize());
  9. } catch (Error $e) {
  10. echo $e->getMessage(), "\n";
  11. }
  12. return 0;
  13. }
  14. $it->uksort('badsort');
  15. ?>
  16. --EXPECT--
  17. Modification of ArrayObject during sorting is prohibited