Re: PHP_STREAM_TO_ZVAL
| From: | Christoph M. Becker | Date: | Thu, 24 Nov 2022 16:05:27 +0000 |
| Subject: | Re: PHP_STREAM_TO_ZVAL | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119028@lists.php.net to get a copy of this message | ||
On 24.11.2022 at 16:35, Thomas Hruska wrote:
> In ext/standard/file.c:
>
> #define PHP_STREAM_TO_ZVAL(stream, arg) \
> ZEND_ASSERT(Z_TYPE_P(arg) == IS_RESOURCE); \
> php_stream_from_res(stream, Z_RES_P(arg));
>
> Can someone clarify why that macro is named PHP_STREAM_TO_ZVAL? The
> current name seems to imply the inverse of what actually happens.
Yeah, looks like the commit which introduced that macro[1] got it wrong,
and nobody noticed or changed that later. Maybe you want to provide a
PR which fixes this.
[1]
<https://github.com/php/php-src/commit/39b62f26cfe1f6c93d4009b0651a1a2b5b455345>
--
Christoph M. Becker