mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
18 lines
276 B
PHP
18 lines
276 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 ($value) must be of type Countable|array, Generator given
|