Fix build against PHP 8.6: php_error_docref1() was removed PHP 8.6 removed php_error_docref1() (php-src UPGRADING.INTERNALS, "Removed" section); the docref parameter is no longer supported. The two call sites passed the SMB URL as that parameter, so route them through a SMBCLIENT_ERROR_URL() helper that folds the URL into the message on 8.6+ and keeps php_error_docref1() on older versions. Not fixed upstream: eduardok/libsmbclient-php master still calls php_error_docref1() as of 2026-07-30. --- a/php_smbclient.h +++ b/php_smbclient.h @@ -129,6 +129,17 @@ #define TSRMLS_FETCH() #endif +/* php_error_docref1() was removed in PHP 8.6. It printed the URL as the + * docref parameter, so fold it into the message to keep reporting which + * path failed. */ +#if PHP_VERSION_ID >= 80600 +#define SMBCLIENT_ERROR_URL(url, type, fmt, ...) \ + php_error_docref(NULL, type, "%s: " fmt, url, __VA_ARGS__) +#else +#define SMBCLIENT_ERROR_URL(url, type, fmt, ...) \ + php_error_docref1(NULL, url, type, fmt, __VA_ARGS__) +#endif + extern php_stream_wrapper php_stream_smb_wrapper; php_smbclient_state * php_smbclient_state_new (php_stream_context *context, int init TSRMLS_DC); void php_smbclient_state_free (php_smbclient_state *state TSRMLS_DC); --- a/smb_streams.c +++ b/smb_streams.c @@ -688,12 +688,12 @@ break; default: - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Unknown option %d for stream_metadata", option); + SMBCLIENT_ERROR_URL(url, E_WARNING, "Unknown option %d for stream_metadata", option); return 0; } php_smb_pool_drop(state TSRMLS_CC); if (ret == -1) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Operation failed: %s", strerror(errno)); + SMBCLIENT_ERROR_URL(url, E_WARNING, "Operation failed: %s", strerror(errno)); return 0; } php_clear_stat_cache(0, NULL, 0 TSRMLS_CC);