watch_001.phpt 991 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --TEST--
  2. Test simple recursive 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. --INI--
  13. opcache.optimization_level=0
  14. --PHPDBG--
  15. b 3
  16. r
  17. w r $b
  18. c
  19. q
  20. --EXPECTF--
  21. [Successful compilation of %s]
  22. prompt> [Breakpoint #0 added at %s:3]
  23. prompt> [Breakpoint #0 at %s:3, hits: 1]
  24. >00003: $a = 1;
  25. 00004: $b = [$a];
  26. 00005:
  27. prompt> [Added recursive watchpoint #0 for $b]
  28. prompt> [Breaking on watchpoint $b]
  29. Old value:
  30. New value: Array ([0] => 1)
  31. >00006: unset($b);
  32. 00007: $b = 2;
  33. 00008:
  34. prompt> [Breaking on watchpoint $b]
  35. Old value inaccessible or destroyed
  36. New value:
  37. >00007: $b = 2;
  38. 00008:
  39. prompt> [Breaking on watchpoint $b]
  40. Old value:
  41. New value: 2
  42. >00008:
  43. prompt> [$b has been removed, removing watchpoint recursively]
  44. [Script ended normally]
  45. prompt>
  46. --FILE--
  47. <?php
  48. $a = 1;
  49. $b = [$a];
  50. unset($b);
  51. $b = 2;