You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Language: clone() on enum unit cases — Error exception (Zend zend_clones.c parity) #3554
Category
languageProblem
Cloning an enum case must throw
Errorin Zend; this compiler throwsLogicException: clone requires an object.ErrorLogicExceptionBacked enum cases share the same restriction.
php-src reference
Zend/zend_clones.c—zend_clone_objenum guardZend/zend_enum.cRepro
Expected behavior
clone SomeEnum::Case→Errorwith Zend-aligned message (Cannot clone enum case, or equivalent)Implementation hints
cloneopcode / builtin: detect enum case objects before generic object cloneError(notLogicException) via VM exception class tableAcceptance
test/compliance/cases/language/clone_enum_case_error.phpt