mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01: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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user