forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't overload get_properties for ArrayObject
Instead overload get_properties_for for a few specific cases such as array casts. This resolves the issue where ArrayObject get_properties may violate engine invariants in some cases.
- Loading branch information
Showing
6 changed files
with
105 additions
and
56 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
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,30 @@ | ||
--TEST-- | ||
get_object_vars() on ArrayObject works on the properties of the ArrayObject itself | ||
--FILE-- | ||
<?php | ||
|
||
class Test { | ||
public $test; | ||
public $test2; | ||
} | ||
|
||
class AO extends ArrayObject { | ||
private $test; | ||
|
||
public function getObjectVars() { | ||
return get_object_vars($this); | ||
} | ||
} | ||
|
||
$ao = new AO(new Test); | ||
var_dump(get_object_vars($ao)); | ||
var_dump($ao->getObjectVars()); | ||
|
||
?> | ||
--EXPECT-- | ||
array(0) { | ||
} | ||
array(1) { | ||
["test"]=> | ||
NULL | ||
} |
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
This file was deleted.
Oops, something went wrong.