Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a7dbfd3

Browse files
Add comment to IS_TYPE_UNINITIALIZED test
1 parent 43362cc commit a7dbfd3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎ext/reflection/tests/ReflectionMethod_getStaticVariables_basic_extra_bleed.phpt‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ function test() {
1010

1111
function foo() {
1212
$methodInfo = new ReflectionFunction(__FUNCTION__);
13-
$null = $methodInfo->getStaticVariables()['a'];
13+
$nullWithIsTypeUninitialized = $methodInfo->getStaticVariables()['a'];
1414

1515
static $a = test();
1616
var_dump($a);
17-
$a = $null;
17+
18+
// Technically, IS_TYPE_UNINITIALIZED does bleed, but it doesn't matter since there's no way we
19+
// can assign it to the static variable directly instead of the reference.
20+
$staticVar = &$methodInfo->getStaticVariables()['a'];
21+
$staticVar = $nullWithIsTypeUninitialized;
1822
}
1923

2024
foo();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /