Skip to content

Commit

Permalink
#2253 - Fix zephir_file_exists() C function in PHP8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Sep 8, 2021
1 parent af7cf0a commit b0248e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernels/ZendEngine3/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ int zephir_file_exists(zval *filename)
}

#if PHP_VERSION_ID >= 80100
php_stat(Z_STRVAL_P(filename), FS_EXISTS, &return_value);
zend_string *file = zend_string_init(Z_STRVAL_P(filename), Z_STRLEN_P(filename), 0);
php_stat(file, FS_EXISTS, &return_value);
zval_ptr_dtor(file);
#else
php_stat(Z_STRVAL_P(filename), (php_stat_len) Z_STRLEN_P(filename), FS_EXISTS, &return_value);
#endif
Expand Down

0 comments on commit b0248e1

Please sign in to comment.