Skip to content

Commit 9a0388c

Browse files
committed
Add test case for use of late static binding static:: outside class scope.
1 parent f157051 commit 9a0388c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Tests/CodeAnalysis/VariableAnalysisUnitTest.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ function function_with_static_members_outside_class() {
185185
return self::$whatever;
186186
}
187187

188+
function function_with_late_static_binding_outside_class() {
189+
echo static::$whatever;
190+
}
191+
188192
function function_with_closure($outer_param) {
189193
$outer_var = 1;
190194
$outer_var2 = 2;

Tests/CodeAnalysis/VariableAnalysisUnitTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ private function _getWarningAndErrorList() {
127127
// function_with_static_members_outside_class() line (+4)
128128
($base += 4) => 0,
129129
($base + 2) => array(0, 1), // self::$whatever
130-
// function_with_closure() line (+5)
130+
// function_with_late_static_binding_outside_class() line (+5)
131131
($base += 5) => 0,
132+
($base + 1) => array(0, 1), // static::$whatever
133+
// function_with_closure() line (+4)
134+
($base += 4) => 0,
132135
($base + 5) => 1, // $outer_param
133136
($base + 7) => 1, // $outer_var
134137
($base + 8) => 1, // $outer_var2

0 commit comments

Comments
 (0)