[php-src] Issue #20914: Internal enums can be cloned
[email protected] (arnaud-lb)
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Issue: https://github.com/php/php-src/issues/20914 Author: arnaud-lb ### Description The following code: ```php <?php var_dump(clone(ZendTestIntEnum::Foo) === ZendTestIntEnum::Foo); ``` Resulted in this output: ``` bool(false) ``` But I expected this output instead: ``` Uncaught Error: Trying to clone an uncloneable object of class ZendTestIntEnum ``` This is because we don't override the default object handlers in `zend_register_internal_enum()`. ### PHP Version ```plain PHP 8.3 ``` ### Operating System _No response_