watch_003.phpt 853 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --TEST--
  2. Test simple watchpoint with replace
  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 6
  14. r
  15. w $a[0]
  16. c
  17. q
  18. --EXPECTF--
  19. [Successful compilation of %s]
  20. prompt> [Breakpoint #0 added at %s:6]
  21. prompt> [Breakpoint #0 at %s:6, hits: 1]
  22. >00006: $a[0] = 2;
  23. 00007:
  24. 00008: $a = [0 => 3, 1 => 4];
  25. prompt> [Added watchpoint #0 for $a[0]]
  26. prompt> [Breaking on watchpoint $a[0]]
  27. Old value: 1
  28. New value: 2
  29. >00008: $a = [0 => 3, 1 => 4];
  30. 00009:
  31. prompt> [Breaking on watchpoint $a[0]]
  32. Old value: 2
  33. New value: 3
  34. >00009:
  35. prompt> [$a[0] has been removed, removing watchpoint]
  36. [Script ended normally]
  37. prompt>
  38. --FILE--
  39. <?php
  40. $a = [];
  41. $a[0] = 1;
  42. $a[0] = 2;
  43. $a = [0 => 3, 1 => 4];