From c1d1596cdca368727912a5bb39a92b1984d4967d Mon Sep 17 00:00:00 2001 From: rainerjung Date: Sun, 5 Jul 2026 11:33:55 +0200 Subject: [PATCH 1/2] PHP 8.6 compatibility: Replace zval_is_true It is defined for PHP 8.0-8.5 in Zend/zend_operators.h as #define zval_is_true(op) \ zend_is_true(op) The original commit adding it to php-src was 27dc598, the commit finally removing it and replacing every use of it by zend_is_true() was commit 985d681. --- ssh2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssh2.c b/ssh2.c index 0bb7ce6..fca4192 100644 --- a/ssh2.c +++ b/ssh2.c @@ -158,7 +158,7 @@ LIBSSH2_MACERROR_FUNC(php_ssh2_macerror_cb) if (FAILURE == call_user_function(NULL, NULL, data->macerror_cb, &zretval, 1, args)) { php_error_docref(NULL, E_WARNING, "Failure calling macerror callback"); } else { - retval = zval_is_true(&zretval) ? 0 : -1; + retval = zend_is_true(&zretval) ? 0 : -1; } if (Z_TYPE_P(&zretval) != IS_UNDEF) { zval_ptr_dtor(&zretval); From 6290af0d90abdf48f322c423f091adf67f6766a3 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 8 Sep 2026 10:58:32 +0200 Subject: [PATCH 2/2] use zval_ptr_dtor_nogc instead of zval_dtor alias --- ssh2_fopen_wrappers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssh2_fopen_wrappers.c b/ssh2_fopen_wrappers.c index f1b3ce1..61e41f8 100644 --- a/ssh2_fopen_wrappers.c +++ b/ssh2_fopen_wrappers.c @@ -557,7 +557,7 @@ static php_stream *php_ssh2_shell_open(LIBSSH2_SESSION *session, zend_resource * if (libssh2_channel_setenv_ex(channel, key->val, key->len, Z_STRVAL(copyval), Z_STRLEN(copyval))) { php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", ZSTR_VAL(key), Z_STRVAL(copyval)); } - zval_dtor(©val); + zval_ptr_dtor_nogc(©val); } } else { php_error_docref(NULL, E_NOTICE, "Skipping numeric index in environment array"); @@ -831,7 +831,7 @@ static php_stream *php_ssh2_exec_command(LIBSSH2_SESSION *session, zend_resource if (libssh2_channel_setenv_ex(channel, key->val, key->len, Z_STRVAL(copyval), Z_STRLEN(copyval))) { php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", ZSTR_VAL(key), Z_STRVAL(copyval)); } - zval_dtor(©val); + zval_ptr_dtor_nogc(©val); } } else { php_error_docref(NULL, E_NOTICE, "Skipping numeric index in environment array");