xref: /PHP-8.1/Zend/tests/enum/no-clone.phpt (revision 269c8dac)
1--TEST--
2Enum disallows cloning
3--FILE--
4<?php
5
6enum Foo {
7    case Bar;
8}
9
10try {
11    var_dump(clone Foo::Bar);
12} catch (Error $e) {
13    echo $e->getMessage() . "\n";
14}
15
16?>
17--EXPECT--
18Trying to clone an uncloneable object of class Foo
19