watch_005.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --TEST--
  2. Test proper watch comparisons when having multiple levels of indirection from a zval to its value
  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 3
  14. r
  15. w r $a
  16. c
  17. q
  18. --EXPECTF--
  19. [Successful compilation of %s]
  20. prompt> [Breakpoint #0 added at %s:3]
  21. prompt> [Breakpoint #0 at %s:3, hits: 1]
  22. >00003: $b = "a";
  23. 00004: $a = $b.$b;
  24. 00005: $c = &$a;
  25. prompt> [Added recursive watchpoint #0 for $a]
  26. prompt> [Breaking on watchpoint $a]
  27. Old value:
  28. New value: aa
  29. >00005: $c = &$a;
  30. 00006: $a[1] = "b";
  31. 00007:
  32. prompt> [Breaking on watchpoint $a]
  33. Old value inaccessible or destroyed
  34. New value (reference): aa
  35. >00006: $a[1] = "b";
  36. 00007:
  37. 00008: exit;
  38. prompt> [Breaking on watchpoint $a]
  39. Old value: aa
  40. New value: ab
  41. >00008: exit;
  42. 00009:
  43. prompt> [$a has been removed, removing watchpoint recursively]
  44. [Script ended normally]
  45. prompt>
  46. --FILE--
  47. <?php
  48. $b = "a";
  49. $a = $b.$b;
  50. $c = &$a;
  51. $a[1] = "b";
  52. exit;