note 130180 added to function.stream-get-line
| From: | cool@user.com | Date: | Fri, 21 Mar 2025 03:37:00 +0000 |
| Subject: | note 130180 added to function.stream-get-line | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-222012@lists.php.net to get a copy of this message | ||
This function is very efficient to redirect streams. I have older scripts to compare, and recent
versions of PHP are so fast, that sometimes 2 lines might get fed into one, and this happens only on
PHP 8.3 and 8.4.
After digging, i found that throttling a bit is the best to do to maintain retro compatibility.
$line = stream_get_line($response, 1024, "\n");
usleep(10000);
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 37.174.47.191)
----
Manual Page -- https://php.net/manual/en/function.stream-get-line.php
Edit -- https://main.php.net/note/edit/130180
Del: integrated -- https://main.php.net/note/delete/130180/integrated
Del: useless -- https://main.php.net/note/delete/130180/useless
Del: bad code -- https://main.php.net/note/delete/130180/bad+code
Del: spam -- https://main.php.net/note/delete/130180/spam
Del: non-english -- https://main.php.net/note/delete/130180/non-english
Del: in docs -- https://main.php.net/note/delete/130180/in+docs
Del: other reasons-- https://main.php.net/note/delete/130180
Reject -- https://main.php.net/note/reject/130180
Search -- https://main.php.net/manage/user-notes.php