mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
main/streams: Add a new helper function to get a php_stream from a zval without errors
This is intended to replace the few manual usages of zend_fetch_resource2_ex() to fetch a php_stream from a zval. This will simplify the conversion from resource to object for streams when this actually happens.
This commit is contained in:
parent
908490764b
commit
2244810dcf
1 changed files with 4 additions and 0 deletions
|
@ -285,6 +285,10 @@ END_EXTERN_C()
|
|||
#define php_stream_from_res_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource2((res), "stream", php_file_le_stream(), php_file_le_pstream())
|
||||
#define php_stream_from_zval_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), "stream", php_file_le_stream(), php_file_le_pstream())
|
||||
|
||||
static zend_always_inline php_stream* php_stream_from_zval_no_verify_no_error(zval *zval) {
|
||||
return (php_stream*)zend_fetch_resource2_ex(zval, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
}
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
static zend_always_inline bool php_stream_zend_parse_arg_into_stream(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue