mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
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
17 lines
272 B
PHP
17 lines
272 B
PHP
--TEST--
|
|
Enum disallows cloning (internal enum)
|
|
--EXTENSIONS--
|
|
zend_test
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
var_dump(clone ZendTestIntEnum::Foo);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage() . "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Trying to clone an uncloneable object of class ZendTestIntEnum
|