watch_002.phpt 758 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. Test simple array 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 $a
  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[]]
  26. prompt> [Breaking on watchpoint $a[]]
  27. 1 elements were added to the array
  28. >00009:
  29. prompt> [$a[] has been removed, removing watchpoint]
  30. [Script ended normally]
  31. prompt>
  32. --FILE--
  33. <?php
  34. $a = [];
  35. $a[0] = 1;
  36. $a[0] = 2;
  37. $a = [0 => 3, 1 => 4];