Skip to content

Commit 33ac62d

Browse files
committed
Check ZEND_ACC_NODISCARD together with ZEND_ACC_DEPRECATED
1 parent 4e99f8d commit 33ac62d

File tree

16 files changed

+90
-141
lines changed

16 files changed

+90
-141
lines changed

Zend/tests/attributes/nodiscard/001.phpt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,24 @@ $closure2();
6363

6464
?>
6565
--EXPECTF--
66-
Warning: The return value of function test() is expected to be consumed in %s on line %d
66+
Warning: (B)The return value of function test() is expected to be consumed in %s on line %d
6767

68-
Warning: The return value of function test2() is expected to be consumed, this is important in %s on line %d
68+
Warning: (B)The return value of function test2() is expected to be consumed, this is important in %s on line %d
6969

70-
Warning: The return value of function test3() is expected to be consumed in %s on line %d
70+
Warning: (B)The return value of function test3() is expected to be consumed in %s on line %d
7171

72-
Warning: The return value of function test() is expected to be consumed in %s on line %d
72+
Warning: (A)The return value of function test() is expected to be consumed in %s on line %d
7373

74-
Warning: The return value of function test() is expected to be consumed in %s on line %d
74+
Warning: (A)The return value of function test() is expected to be consumed in %s on line %d
7575

76-
Warning: The return value of method Clazz::test() is expected to be consumed in %s on line %d
76+
Warning: (A)The return value of method Clazz::test() is expected to be consumed in %s on line %d
7777

78-
Warning: The return value of method Clazz::test2() is expected to be consumed, this is important in %s on line %d
78+
Warning: (A)The return value of method Clazz::test2() is expected to be consumed, this is important in %s on line %d
7979

80-
Warning: The return value of method Clazz::test3() is expected to be consumed in %s on line %d
80+
Warning: (B)The return value of method Clazz::test3() is expected to be consumed in %s on line %d
8181

82-
Warning: The return value of method Clazz::test() is expected to be consumed in %s on line %d
82+
Warning: (A)The return value of method Clazz::test() is expected to be consumed in %s on line %d
8383

84-
Warning: The return value of function {closure:%s:%d}() is expected to be consumed in %s on line %d
84+
Warning: (A)The return value of function {closure:%s:%d}() is expected to be consumed in %s on line %d
8585

86-
Warning: The return value of function {closure:%s:%d}() is expected to be consumed in %s on line %d
86+
Warning: (A)The return value of function {closure:%s:%d}() is expected to be consumed in %s on line %d

Zend/tests/attributes/nodiscard/002.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ $cls('foo');
3333

3434
?>
3535
--EXPECTF--
36+
Warning: (A)The return value of method Clazz::test() is expected to be consumed in %s on line %d
3637
__call(test)
3738

38-
Warning: The return value of method Clazz::__call() is expected to be consumed in %s on line %d
39+
Warning: (A)The return value of method Clazz::test() is expected to be consumed in %s on line %d
3940
__callStatic(test)
4041

41-
Warning: The return value of method Clazz::__callStatic() is expected to be consumed in %s on line %d
42+
Warning: (A)The return value of method Clazz::__invoke() is expected to be consumed in %s on line %d
4243
__invoke(foo)
4344

44-
Warning: The return value of method Clazz::__invoke() is expected to be consumed in %s on line %d

Zend/tests/attributes/nodiscard/003.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ $cls->test();
1919

2020
?>
2121
--EXPECTF--
22-
Warning: The return value of method Clazz::test() is expected to be consumed in %s on line %d
22+
Warning: (A)The return value of method Clazz::test() is expected to be consumed in %s on line %d

Zend/tests/attributes/nodiscard/005.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ $date->setTimestamp(0);
1212

1313
?>
1414
--EXPECTF--
15-
Warning: The return value of function flock() is expected to be consumed, as locking the stream might have failed in %s on line %d
15+
Warning: (B)The return value of function flock() is expected to be consumed, as locking the stream might have failed in %s on line %d
1616

17-
Warning: The return value of method DateTimeImmutable::setTimestamp() is expected to be consumed, as DateTimeImmutable::setTimestamp() does not modify the object itself in %s on line %d
17+
Warning: (A)The return value of method DateTimeImmutable::setTimestamp() is expected to be consumed, as DateTimeImmutable::setTimestamp() does not modify the object itself in %s on line %d

Zend/tests/attributes/nodiscard/006.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ test();
1717

1818
?>
1919
--EXPECTF--
20-
Warning: The return value of function test() is expected to be consumed in %s on line %d
20+
Warning: (A)The return value of function test() is expected to be consumed in %s on line %d

Zend/tests/attributes/nodiscard/007.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ fclose($f);
1414
?>
1515
--EXPECTF--
1616
<!-- internal enter tmpfile() -->
17-
<!-- internal enter flock() -->
1817
<!-- internal enter NoDiscard::__construct() -->
1918

20-
Warning: The return value of function flock() is expected to be consumed, as locking the stream might have failed in %s on line %d
19+
Warning: (A)The return value of function flock() is expected to be consumed, as locking the stream might have failed in %s on line %d
20+
<!-- internal enter flock() -->
2121
<!-- internal enter fclose() -->

Zend/tests/attributes/nodiscard/008.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ test();
1515
--EXPECTF--
1616
Deprecated: Function test() is deprecated in %s on line %d
1717

18-
Warning: The return value of function test() is expected to be consumed in %s on line %d
18+
Warning: (B)The return value of function test() is expected to be consumed in %s on line %d

Zend/tests/attributes/nodiscard/009.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ zend_test_deprecated_nodiscard();
1111
--EXPECTF--
1212
Deprecated: Function zend_test_deprecated_nodiscard() is deprecated, custom message in %s on line %d
1313

14-
Warning: The return value of function zend_test_deprecated_nodiscard() is expected to be consumed, custom message 2 in %s on line %d
14+
Warning: (B)The return value of function zend_test_deprecated_nodiscard() is expected to be consumed, custom message 2 in %s on line %d

Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ try {
3131

3232
?>
3333
--EXPECT--
34-
Caught: The return value of function test() is expected to be consumed
35-
Caught: The return value of function test2() is expected to be consumed
34+
Caught: (B)The return value of function test() is expected to be consumed
35+
Caught: (B)The return value of function test2() is expected to be consumed

Zend/tests/attributes/nodiscard/type_validation_001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ test();
1212

1313
?>
1414
--EXPECTF--
15-
Warning: The return value of function test() is expected to be consumed, 1234 in %s on line %d
15+
Warning: (B)The return value of function test() is expected to be consumed, 1234 in %s on line %d

0 commit comments

Comments
 (0)