forked from xdebug/xdebug
/
bug00651.phpt
64 lines (60 loc) · 816 Bytes
/
bug00651.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--TEST--
Test for bug #651: Incorrect code coverage after ! empty() in conditional
--INI--
xdebug.overload_var_dump=0
--FILE--
<?php
xdebug_start_code_coverage(XDEBUG_CC_UNUSED);
function repeat($x)
{
if ( ! empty($x)
AND $x !== 1
AND $x !== 2
AND $x !== 3)
{
$y = 'covered';
}
}
repeat(0);
repeat(1);
repeat(2);
repeat(3);
repeat(4);
var_dump(xdebug_get_code_coverage());
?>
--EXPECTF--
array(1) {
["%sbug00651.php"]=>
array(15) {
[5]=>
int(1)
[7]=>
int(1)
[8]=>
int(1)
[9]=>
int(1)
[10]=>
int(1)
[11]=>
int(1)
[12]=>
int(1)
[13]=>
int(1)
[14]=>
int(1)
[16]=>
int(1)
[17]=>
int(1)
[18]=>
int(1)
[19]=>
int(1)
[20]=>
int(1)
[22]=>
int(1)
}
}