-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GH-17234: Numeric parent hook call fails with assertion
The current code expects the property name to be a string, but it can also be a number via the {} syntax. Handle this consistently to a string by using zval_get_string which will do the type coercion and refcount update (instead of assuming string and doing an explicit string copy). Closes GH-17236.
- Loading branch information
Showing
3 changed files
with
21 additions
and
2 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
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,15 @@ | ||
--TEST-- | ||
GH-17234 (Numeric parent hook call fails with assertion) | ||
--FILE-- | ||
<?php | ||
class ParentC {} | ||
class Child extends ParentC { | ||
public $a { | ||
get { | ||
return parent::${0}::get (); | ||
} | ||
} | ||
} | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Must not use parent::$0::get() in a different property ($a) in %s on line %d |
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