Код: Выделить всё
$options = [
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n"
. 'Content-Length: ' . strlen($content),
'content' => $content,
'timeout' => 30,
],
];
$context = stream_context_create($options);
$stream = fopen($url, 'r', false, $context);
$read[] = $stream;
$write = null;
$except = null;
$streamsChanged = stream_select($read, $write, $except, 0, 50000);
Код: Выделить всё
Type: ValueError
Message: No stream arrays were passed
Var_dump $stream возвращает ресурс(поток), поэтому тип кажется правильным. Я также запустил:
Код: Выделить всё
is_resource($stream)
&& get_resource_type($stream) === 'stream'
&& !feof($stream)
Подробнее здесь: https://stackoverflow.com/questions/798 ... -8-upgrade
Мобильная версия