1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
--TEST--
Serialization of properties should not deal INDIRECT entries to userland
--FILE--
<?php
class MyArrayObject extends ArrayObject {
private $unused = 123;
public function __construct(array $array)
{
parent::__construct($array, 1);
}
}
class MySplDoublyLinkedList extends SplDoublyLinkedList {
private $unused = 123;
}
class MySplObjectStorage extends SplObjectStorage {
private $unused = 123;
}
$x = new MyArrayObject([]);
var_dump($x->__serialize());
$x = new MySplDoublyLinkedList();
var_dump($x->__serialize());
$x = new MySplObjectStorage();
var_dump($x->__serialize());
?>
--EXPECTF--
array(4) {
[0]=>
int(1)
[1]=>
array(0) {
}
[2]=>
array(1) {
["%0MyArrayObject%0unused"]=>
int(123)
}
[3]=>
NULL
}
array(3) {
[0]=>
int(0)
[1]=>
array(0) {
}
[2]=>
array(1) {
["%0MySplDoublyLinkedList%0unused"]=>
int(123)
}
}
array(2) {
[0]=>
array(0) {
}
[1]=>
array(1) {
["%0MySplObjectStorage%0unused"]=>
int(123)
}
}
|