mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects This also moves tests into a subfolder.
31 lines
641 B
PHP
31 lines
641 B
PHP
--TEST--
|
|
Bug #41691 (ArrayObject::exchangeArray hangs Apache)
|
|
--FILE--
|
|
<?php
|
|
|
|
class A extends ArrayObject {
|
|
public function __construct($dummy, $flags) {
|
|
parent::__construct($this, $flags);
|
|
}
|
|
public $a;
|
|
public $b;
|
|
public $c;
|
|
}
|
|
|
|
$a = new A(null, ArrayObject::ARRAY_AS_PROPS );
|
|
var_dump($a->exchangeArray(array('a'=>1,'b'=>1,'c'=>1)));
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants in %s on line %d
|
|
array(3) {
|
|
["a"]=>
|
|
NULL
|
|
["b"]=>
|
|
NULL
|
|
["c"]=>
|
|
NULL
|
|
}
|
|
Done
|