watch_006.phpt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. --TEST--
  2. Test multiple watch elements pointing to the same watchpoint
  3. --SKIPIF--
  4. <?php
  5. if (PHP_INT_SIZE == 4) {
  6. die("xfail There may be flaws in the implementation of watchpoints that cause failures");
  7. }
  8. if (getenv('SKIP_ASAN')) {
  9. die("skip intentionally causes segfaults");
  10. }
  11. ?>
  12. --PHPDBG--
  13. b 4
  14. r
  15. w $a[0]
  16. w r $b
  17. c
  18. q
  19. --EXPECTF--
  20. [Successful compilation of %s]
  21. prompt> [Breakpoint #0 added at %s:4]
  22. prompt> [Breakpoint #0 at %s:4, hits: 1]
  23. >00004: $a[0] = 1;
  24. 00005: $b = &$a;
  25. 00006: $a[0] = 2;
  26. prompt> [Added watchpoint #0 for $a[0]]
  27. prompt> [Added recursive watchpoint #1 for $b]
  28. prompt> [Breaking on watchpoint $a[0]]
  29. Old value: 0
  30. New value: 1
  31. >00005: $b = &$a;
  32. 00006: $a[0] = 2;
  33. 00007: $a[1] = 3;
  34. prompt> [Breaking on watchpoint $b]
  35. Old value:
  36. New value (reference): Array ([0] => 1)
  37. >00006: $a[0] = 2;
  38. 00007: $a[1] = 3;
  39. 00008: $c = [1];
  40. prompt> [Breaking on watchpoint $a[0]]
  41. Old value: 1
  42. New value: 2
  43. >00007: $a[1] = 3;
  44. 00008: $c = [1];
  45. 00009: $b = &$c;
  46. prompt> [Element 1 has been added to watchpoint]
  47. [Breaking on watchpoint $b[]]
  48. 1 elements were added to the array
  49. >00008: $c = [1];
  50. 00009: $b = &$c;
  51. 00010:
  52. prompt> [Breaking on watchpoint $b]
  53. Old value inaccessible or destroyed
  54. New value (reference): Array ([0] => 2,[1] => 3)
  55. >00009: $b = &$c;
  56. 00010:
  57. prompt> [Breaking on watchpoint $b]
  58. Old value inaccessible or destroyed
  59. New value (reference): Array ([0] => 1)
  60. >00010:
  61. prompt> [$b has been removed, removing watchpoint recursively]
  62. [$a[0] has been removed, removing watchpoint]
  63. [Script ended normally]
  64. prompt>
  65. --FILE--
  66. <?php
  67. $a = [0];
  68. $a[0] = 1;
  69. $b = &$a;
  70. $a[0] = 2;
  71. $a[1] = 3;
  72. $c = [1];
  73. $b = &$c;