Skip to content

Internal enums can be cloned and comparedΒ #20914

@arnaud-lb

Description

@arnaud-lb

Description

The following code:

<?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

PHP 8.3

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions