meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
284 Bytes
--TEST--
Generators cannot be cloned
--FILE--
<?php
function gen() {
yield;
}
try {
$gen = gen();
clone $gen;
} catch (Throwable $e) {
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Error: Trying to clone an uncloneable object of class Generator