mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00

* Make handling of SplFixedArray properties more consistent Create a brand new reference counted array every time in SplFixedArray to be freed by the callers (or return null). Switch from overriding `get_properties` to overriding `get_properties_for` handler * Print objects with null hash table like others in print_r Noticed when working on subsequent commits for SplFixedArray. Make whether zend_get_properties_for returns null or an empty array invisible to the end user - it would be always be a non-null array for user-defined classes. Always print newlines with `\n\s*(\n\s*)` after objects Noticed when working on SplFixedArray changes, e.g. in ext/spl/tests/SplFixedArray__construct_param_null.phpt
28 lines
623 B
PHP
28 lines
623 B
PHP
--TEST--
|
|
SplFixedArray properties is compatible with ArrayObject
|
|
--FILE--
|
|
<?php
|
|
$ao = new ArrayObject([1, 2, 3]);
|
|
$fixedArray = new SplFixedArray(1);
|
|
$fixedArray[0] = new SplDoublyLinkedList();
|
|
$ao->exchangeArray($fixedArray);
|
|
$ao[0] = new stdClass();
|
|
var_dump($ao);
|
|
?>
|
|
--EXPECT--
|
|
object(ArrayObject)#1 (1) {
|
|
["storage":"ArrayObject":private]=>
|
|
object(SplFixedArray)#2 (2) {
|
|
[0]=>
|
|
object(SplDoublyLinkedList)#3 (2) {
|
|
["flags":"SplDoublyLinkedList":private]=>
|
|
int(0)
|
|
["dllist":"SplDoublyLinkedList":private]=>
|
|
array(0) {
|
|
}
|
|
}
|
|
["0"]=>
|
|
object(stdClass)#4 (0) {
|
|
}
|
|
}
|
|
}
|