dis-bench / src /php /php-src /ext /reflection /tests /ReflectionClass_CannotClone_basic.phpt
meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
353 Bytes
--TEST--
Reflection class cannot be cloned
--CREDITS--
Stefan Koopmanschap <stefan@phpgg.nl>
TestFest PHP|Tek
--FILE--
<?php
$rc = new ReflectionClass("stdClass");
try {
$rc2 = clone($rc);
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Error: Trying to clone an uncloneable object of class ReflectionClass