1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/spl/tests/bug61326.phpt
Nikita Popov 902d64390e Deprecate implicit dynamic properties
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
2021-11-26 14:10:11 +01:00

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)