bug62073.phpt 387 B

12345678910111213141516171819202122
  1. --TEST--
  2. Bug #62073 (different ways of iterating over an SplMaxHeap result in different keys)
  3. --FILE--
  4. <?php
  5. $heap = new SplMaxHeap();
  6. $heap->insert(42);
  7. foreach ($heap as $key => $value) {
  8. var_dump($key);
  9. var_dump($value);
  10. break;
  11. }
  12. $heap = new SplMaxHeap();
  13. $heap->insert(42);
  14. var_dump($heap->key());
  15. var_dump($heap->current());
  16. ?>
  17. --EXPECT--
  18. int(0)
  19. int(42)
  20. int(0)
  21. int(42)