watch_003.phpt 635 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. Test simple watchpoint with replace
  3. --PHPDBG--
  4. b 6
  5. r
  6. w $a[0]
  7. c
  8. q
  9. --EXPECTF--
  10. [Successful compilation of %s]
  11. prompt> [Breakpoint #0 added at %s:6]
  12. prompt> [Breakpoint #0 at %s:6, hits: 1]
  13. >00006: $a[0] = 2;
  14. 00007:
  15. 00008: $a = [0 => 3, 1 => 4];
  16. prompt> [Added watchpoint #0 for $a[0]]
  17. prompt> [Breaking on watchpoint $a[0]]
  18. Old value: 1
  19. New value: 2
  20. >00008: $a = [0 => 3, 1 => 4];
  21. 00009:
  22. prompt> [Breaking on watchpoint $a[0]]
  23. Old value: 2
  24. New value: 3
  25. >00009:
  26. prompt> [$a[0] has been removed, removing watchpoint]
  27. [Script ended normally]
  28. prompt>
  29. --FILE--
  30. <?php
  31. $a = [];
  32. $a[0] = 1;
  33. $a[0] = 2;
  34. $a = [0 => 3, 1 => 4];