mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +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
18 lines
328 B
PHP
18 lines
328 B
PHP
--TEST--
|
|
Test DateInterval props with dimension handling
|
|
--FILE--
|
|
<?php
|
|
class Z extends DateInterval{}
|
|
$z = new Z('P2Y4DT6H8M');
|
|
$i = 0;
|
|
$z->prop[1]=10;
|
|
while ($i < 1026) {
|
|
$z->prop[$i] = $i;
|
|
$i++;
|
|
}
|
|
?>
|
|
==NOCRASH==
|
|
--EXPECTF--
|
|
Deprecated: Creation of dynamic property Z::$prop is deprecated in %s on line %d
|
|
==NOCRASH==
|