mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
RFC: https://wiki.php.net/rfc/enumerations Co-authored-by: Nikita Popov <nikita.ppv@gmail.com> Closes GH-6489.
19 lines
235 B
PHP
19 lines
235 B
PHP
--TEST--
|
|
Enum disallows cloning
|
|
--FILE--
|
|
<?php
|
|
|
|
enum Foo {
|
|
case Bar;
|
|
}
|
|
|
|
try {
|
|
var_dump(clone Foo::Bar);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage() . "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Trying to clone an uncloneable object of class Foo
|