diff options
| author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-02 15:19:32 +0200 |
|---|---|---|
| committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-02 15:19:32 +0200 |
| commit | 486b8b1cd193fb5bb12d4810b18e076bb1f3933b (patch) | |
| tree | 9bc050fe28432f3764006239a8ae060ffc3610f9 /sapi/phpdbg/tests | |
| parent | f733047ae2af425f0b83c7e7ac3f19166947cac5 (diff) | |
| parent | af4a9bf1bf9109714e0e45aaf907e9809abb6217 (diff) | |
| download | php-git-486b8b1cd193fb5bb12d4810b18e076bb1f3933b.tar.gz | |
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix #73927: phpdbg fails with windows error prompt at "watch array"
Diffstat (limited to 'sapi/phpdbg/tests')
| -rw-r--r-- | sapi/phpdbg/tests/bug73927.phpt | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/sapi/phpdbg/tests/bug73927.phpt b/sapi/phpdbg/tests/bug73927.phpt new file mode 100644 index 0000000000..81a1d2fa47 --- /dev/null +++ b/sapi/phpdbg/tests/bug73927.phpt @@ -0,0 +1,51 @@ +--TEST-- +Bug #73927 (phpdbg fails with windows error prompt at "watch array") +--PHPDBG-- +b 19 +r +c +w $value +w $lower[] +q +--EXPECTF-- +[Successful compilation of %s] +prompt> [Breakpoint #0 added at %s:%d] +prompt> [Breakpoint #0 at %s:%d, hits: 1] +>00019: if ($value < 100) { + 00020: $lower[] = $value; + 00021: } else { +prompt> [Breakpoint #0 at %s:%d, hits: 2] +>00019: if ($value < 100) { + 00020: $lower[] = $value; + 00021: } else { +prompt> [Added watchpoint #0 for $value] +prompt> [Added watchpoint #1 for $lower[0]] +prompt> [$lower[0] has been removed, removing watchpoint] +[$value has been removed, removing watchpoint] +--FILE-- +<?php + +// Generate some mock data +$example = [1, 23, 23423, 256436, 3463, 4363, 457]; +foreach (range(1, 1000) as $val) { + $example[] = mt_rand(1, 10000); +} + +// Stuff to debug +function doCoolStuff($value) +{ + $value++; + + return mt_rand(1, 1000); +} + +$lower = []; +foreach ($example as $key => $value) { + if ($value < 100) { + $lower[] = $value; + } else { + doCoolStuff($value); + } +} + +?> |
