Skip to content

Commit

Permalink
#2255 - Fix zephir_filemtime() 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 b0248e1 commit 27c2e71
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 @@ -295,7 +295,9 @@ void zephir_filemtime(zval *return_value, zval *path)
{
if (EXPECTED(Z_TYPE_P(path) == IS_STRING)) {
#if PHP_VERSION_ID >= 80100
php_stat(Z_STRVAL_P(path), FS_MTIME, return_value);
zend_string *file = zend_string_init(Z_STRVAL_P(path), Z_STRLEN_P(path), 0);
php_stat(file, FS_MTIME, &return_value);
zval_ptr_dtor(file);
#else
php_stat(Z_STRVAL_P(path), (php_stat_len)(Z_STRLEN_P(path)), FS_MTIME, return_value);
#endif
Expand Down

0 comments on commit 27c2e71

Please sign in to comment.