[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_
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.