1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00
Files
archived-php-src/sapi/phpdbg/tests/match_breakpoints_001.phpt
Ilija Tovilo 8a49310f4e Adjust assignment line number for match
Otherwise the assignment will have the same number as the default arm
which will 1. mis-trigger a breakpoint and 2. mark the line as covered
even when it isn't.

Closes GH-6083
2020-09-08 00:08:18 +02:00

31 lines
541 B
PHP

--TEST--
Test match default breakpoint with variable assignment
--INI--
opcache.enable_cli=0
--PHPDBG--
b 5
b 10
r
q
--EXPECTF--
[Successful compilation of %s.php]
prompt> [Breakpoint #0 added at %s.php:5]
prompt> [Breakpoint #1 added at %s.php:10]
prompt> [Breakpoint #1 at %s.php:10, hits: 1]
>00010: default => 'bar', // breakpoint #1
00011: };
00012:
prompt>
--FILE--
<?php
$foo = match (0) {
0 => 'foo',
default => 'bar', // breakpoint #0
};
$foo = match (1) {
0 => 'foo',
default => 'bar', // breakpoint #1
};