mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
Writing to a proprety that hasn't been declared is deprecated, unless the class uses the #[AllowDynamicProperties] attribute or defines __get()/__set(). RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
21 lines
415 B
PHP
21 lines
415 B
PHP
--TEST--
|
|
Bug #61326: ArrayObject comparison
|
|
--FILE--
|
|
<?php
|
|
$aobj1 = new ArrayObject(array(0));
|
|
$aobj2 = new ArrayObject(array(1));
|
|
var_dump($aobj1 == $aobj2);
|
|
|
|
$aobj3 = new ArrayObject(array(0));
|
|
var_dump($aobj1 == $aobj3);
|
|
|
|
$aobj3->foo = 'bar';
|
|
var_dump($aobj1 == $aobj3);
|
|
?>
|
|
--EXPECTF--
|
|
bool(false)
|
|
bool(true)
|
|
|
|
Deprecated: Creation of dynamic property ArrayObject::$foo is deprecated in %s on line %d
|
|
bool(false)
|