@@ -45,14 +45,22 @@ int zephir_require_ret(zval *return_value_ptr, const char *require_path)
4545 }
4646#endif
4747
48- ret = php_stream_open_for_zend_ex (require_path , & file_handle , USE_PATH |STREAM_OPEN_FOR_INCLUDE );
48+ #if PHP_VERSION_ID >= 80100
49+ zend_string * zend_string_path = zend_string_init (require_path , strlen (require_path ), 0 );
50+
51+ zend_stream_init_filename_ex (& file_handle , zend_string_path );
52+ ret = php_stream_open_for_zend_ex (& file_handle , USE_PATH |STREAM_OPEN_FOR_INCLUDE );
53+
54+ zval_ptr_dtor (zend_string_path );
55+ #else
56+ ret = php_stream_open_for_zend_ex (require_path , & file_handle , USE_PATH |STREAM_OPEN_FOR_INCLUDE );
57+ #endif
4958 if (ret != SUCCESS ) {
5059 return FAILURE ;
5160 }
5261
5362 new_op_array = zend_compile_file (& file_handle , ZEND_REQUIRE );
5463 if (new_op_array ) {
55-
5664 if (file_handle .handle .stream .handle ) {
5765 ZVAL_NULL (& dummy );
5866 if (!file_handle .opened_path ) {
@@ -110,7 +118,16 @@ int zephir_require_once_ret(zval *return_value_ptr, const char *require_path)
110118 }
111119#endif
112120
113- ret = php_stream_open_for_zend_ex (require_path , & file_handle , USE_PATH |STREAM_OPEN_FOR_INCLUDE );
121+ #if PHP_VERSION_ID >= 80100
122+ zend_string * zend_string_path = zend_string_init (require_path , strlen (require_path ), 0 );
123+
124+ zend_stream_init_filename_ex (& file_handle , zend_string_path );
125+ ret = php_stream_open_for_zend_ex (& file_handle , USE_PATH |STREAM_OPEN_FOR_INCLUDE );
126+
127+ zval_ptr_dtor (zend_string_path );
128+ #else
129+ ret = php_stream_open_for_zend_ex (require_path , & file_handle , USE_PATH |STREAM_OPEN_FOR_INCLUDE );
130+ #endif
114131 if (ret != SUCCESS ) {
115132 return FAILURE ;
116133 }
0 commit comments