mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
18 lines
274 B
PHP
18 lines
274 B
PHP
--TEST--
|
|
Generators can't be counted
|
|
--FILE--
|
|
<?php
|
|
|
|
function gen() { yield; }
|
|
|
|
$gen = gen();
|
|
|
|
try {
|
|
count($gen);
|
|
} catch (\TypeError $e) {
|
|
echo $e->getMessage(), PHP_EOL;
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
count(): Argument #1 ($var) must be of type Countable|array, Generator given
|