Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GH-12207 memory leak of doc blocks of static properties
When declaring the same static property with a doc block in a class and in a trait, the doc block of the property in the class is leaked. While at it, possibly fix doc comment for internal classes. Close GH-12238
- Loading branch information
1 parent
486276f
commit 910f579
Showing
3 changed files
with
31 additions
and
0 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
21 changes: 21 additions & 0 deletions
21
Zend/tests/traits/bugs/overridding-static-property-with-doc-block.phpt
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,21 @@ | ||
--TEST-- | ||
Overriding a static property where both declarations have a doc block does not leak memory | ||
--FILE-- | ||
<?php | ||
trait MyTrait { | ||
/** | ||
* trait comment | ||
*/ | ||
static $property; | ||
} | ||
|
||
class MyClass { | ||
use MyTrait; | ||
|
||
/** | ||
* class comment | ||
*/ | ||
static $property; | ||
} | ||
?> | ||
--EXPECT-- |
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