pqueue_004.phpt 855 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --TEST--
  2. SPL: SplPriorityQueue: var_dump
  3. --FILE--
  4. <?php
  5. $pq = new SplPriorityQueue();
  6. $pq->insert("a", 0);
  7. $pq->insert("b", 1);
  8. $pq->insert("c", 5);
  9. $pq->insert("d", -2);
  10. var_dump($pq);
  11. ?>
  12. ===DONE===
  13. <?php exit(0); ?>
  14. --EXPECTF--
  15. object(SplPriorityQueue)#1 (3) {
  16. ["flags":"SplPriorityQueue":private]=>
  17. int(1)
  18. ["isCorrupted":"SplPriorityQueue":private]=>
  19. bool(false)
  20. ["heap":"SplPriorityQueue":private]=>
  21. array(4) {
  22. [0]=>
  23. array(2) {
  24. ["data"]=>
  25. string(1) "c"
  26. ["priority"]=>
  27. int(5)
  28. }
  29. [1]=>
  30. array(2) {
  31. ["data"]=>
  32. string(1) "a"
  33. ["priority"]=>
  34. int(0)
  35. }
  36. [2]=>
  37. array(2) {
  38. ["data"]=>
  39. string(1) "b"
  40. ["priority"]=>
  41. int(1)
  42. }
  43. [3]=>
  44. array(2) {
  45. ["data"]=>
  46. string(1) "d"
  47. ["priority"]=>
  48. int(-2)
  49. }
  50. }
  51. }
  52. ===DONE===