pqueue_004.phpt 814 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. --EXPECT--
  13. object(SplPriorityQueue)#1 (3) {
  14. ["flags":"SplPriorityQueue":private]=>
  15. int(1)
  16. ["isCorrupted":"SplPriorityQueue":private]=>
  17. bool(false)
  18. ["heap":"SplPriorityQueue":private]=>
  19. array(4) {
  20. [0]=>
  21. array(2) {
  22. ["data"]=>
  23. string(1) "c"
  24. ["priority"]=>
  25. int(5)
  26. }
  27. [1]=>
  28. array(2) {
  29. ["data"]=>
  30. string(1) "a"
  31. ["priority"]=>
  32. int(0)
  33. }
  34. [2]=>
  35. array(2) {
  36. ["data"]=>
  37. string(1) "b"
  38. ["priority"]=>
  39. int(1)
  40. }
  41. [3]=>
  42. array(2) {
  43. ["data"]=>
  44. string(1) "d"
  45. ["priority"]=>
  46. int(-2)
  47. }
  48. }
  49. }