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.
Fix bugs in SplFixedArray unserialization
A typed property of an object properties table is an indirect pointer (IS_IND) to a typed reference (IS_REF). Neither of those should be in the backing array after unserializing an SplFixedArray (see SplFixedArray::fromArray()). I missed this initially when reviewing phpGH-9354
- Loading branch information
1 parent
da9db14
commit 89fe484
Showing
2 changed files
with
36 additions
and
3 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,33 @@ | ||
--TEST-- | ||
SPL: FixedArray: __wakeup | ||
--FILE-- | ||
<?php | ||
#[AllowDynamicProperties] | ||
class MyFixedArray extends SplFixedArray { | ||
public stdClass $x; | ||
public $y; | ||
} | ||
$a = new MyFixedArray(); | ||
$a->x = new stdClass(); | ||
$y = new ArrayObject(); | ||
$a->y = &$y; | ||
$a->z = new stdClass(); | ||
$x = &$a->x; | ||
$a->__wakeup(); | ||
var_dump($a); | ||
?> | ||
--EXPECTF-- | ||
object(MyFixedArray)#%d (3) { | ||
[0]=> | ||
object(stdClass)#%d (0) { | ||
} | ||
[1]=> | ||
object(ArrayObject)#%d (1) { | ||
["storage":"ArrayObject":private]=> | ||
array(0) { | ||
} | ||
} | ||
[2]=> | ||
object(stdClass)#%d (0) { | ||
} | ||
} |