[php-src] Issue #9673: $length argument for fpassthru
| From: | divinity76 | Date: | Wed, 05 Oct 2022 00:11:54 +0000 |
| Subject: | [php-src] Issue #9673: $length argument for fpassthru | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242524@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9673
Author: divinity76
### Description
would be nice to have a
?int $length=null for fpassthru.
currently, implementing [HTTP range
requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests) seems to be a pain:
readfile() isn't suitable because it has neither a $offset nor a $length argument, and
fpassthru isn't suitable either because it doesn't have a $length argument, so you'll
have to resort to a fread()+echo loop.
It would be easier and faster to implement HTTP range support if fpassthru had a $length argument.