watch_006.phpt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. --TEST--
  2. Test multiple watch elements pointing to the same watchpoint
  3. --PHPDBG--
  4. b 4
  5. r
  6. w $a[0]
  7. w r $b
  8. c
  9. q
  10. --EXPECTF--
  11. [Successful compilation of %s]
  12. prompt> [Breakpoint #0 added at %s:4]
  13. prompt> [Breakpoint #0 at %s:4, hits: 1]
  14. >00004: $a[0] = 1;
  15. 00005: $b = &$a;
  16. 00006: $a[0] = 2;
  17. prompt> [Added watchpoint #0 for $a[0]]
  18. prompt> [Added recursive watchpoint #1 for $b]
  19. prompt> [Breaking on watchpoint $a[0]]
  20. Old value: 0
  21. New value: 1
  22. >00005: $b = &$a;
  23. 00006: $a[0] = 2;
  24. 00007: $a[1] = 3;
  25. prompt> [Breaking on watchpoint $b]
  26. Old value:
  27. New value (reference): Array ([0] => 1)
  28. >00006: $a[0] = 2;
  29. 00007: $a[1] = 3;
  30. 00008: $c = [1];
  31. prompt> [Breaking on watchpoint $a[0]]
  32. Old value: 1
  33. New value: 2
  34. >00007: $a[1] = 3;
  35. 00008: $c = [1];
  36. 00009: $b = &$c;
  37. prompt> [Element 1 has been added to watchpoint]
  38. [Breaking on watchpoint $b[]]
  39. 1 elements were added to the array
  40. >00008: $c = [1];
  41. 00009: $b = &$c;
  42. 00010:
  43. prompt> [Breaking on watchpoint $b]
  44. Old value inaccessible or destroyed
  45. New value (reference): Array ([0] => 2,[1] => 3)
  46. >00009: $b = &$c;
  47. 00010:
  48. prompt> [Breaking on watchpoint $b]
  49. Old value inaccessible or destroyed
  50. New value (reference): Array ([0] => 1)
  51. >00010:
  52. prompt> [$b has been removed, removing watchpoint recursively]
  53. [$a[0] has been removed, removing watchpoint]
  54. [Script ended normally]
  55. prompt>
  56. --FILE--
  57. <?php
  58. $a = [0];
  59. $a[0] = 1;
  60. $b = &$a;
  61. $a[0] = 2;
  62. $a[1] = 3;
  63. $c = [1];
  64. $b = &$c;