forked from php/php-src
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scope_is_known() for class constants
Here the active_op_array is still the surrounding file, but we do know the scope.
- Loading branch information
Showing
2 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
Bug #69676: Resolution of self::FOO in class constants not correct | ||
--FILE-- | ||
<?php | ||
class A { | ||
const myConst = "const in A"; | ||
const myDynConst = self::myConst; | ||
} | ||
|
||
class B extends A { | ||
const myConst = "const in B"; | ||
} | ||
|
||
var_dump(B::myDynConst); | ||
var_dump(A::myDynConst); | ||
?> | ||
--EXPECT-- | ||
string(10) "const in A" | ||
string(10) "const in A" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters