1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/enum/no-dynamic-properties-internal.phpt
Arnaud Le Blanc 075b6b85f6 Set default_object_handlers when registering internal enums
Internal enums can be cloned and compared, unlike user enums, because we didn't set default_object_handlers when registering internal enums.

Fix by setting default_object_handlers when registering internal enums.

Fixes GH-20914
Closes GH-20915
2026-01-13 12:32:52 +01:00

19 lines
285 B
PHP

--TEST--
Enum case disallows dynamic properties (internal enum)
--EXTENSIONS--
zend_test
--FILE--
<?php
$bar = ZendTestUnitEnum::Bar;
try {
$bar->baz = 'Baz';
} catch (\Error $e) {
echo $e->getMessage();
}
?>
--EXPECT--
Cannot create dynamic property ZendTestUnitEnum::$baz