SessionInterfaceHandler is throwing a deprecation notice as a warning instead of a deprecation

未关闭 适合新手
#26,001 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
c, php
领域
backend

调研方向

issue 指向 ext/session/session.c 中的 session_handler_interface_gets_implemented()。阅读两处缺失方法检查,并查找附近类似的 deprecation 级别诊断,以遵循项目惯例。更改这些通知的警告级别,然后运行相关的 session 测试,并确认缺少 create_sid() 和 validateId() 时会产生 deprecation 通知。

由索引模型根据 Issue 内容生成。

描述

Bug Status: Needs Triage
Description

https://github.com/php/php-src/blob/0d7ee35d4cd826b43fcc536d8ef666726bef9c79/ext/session/session.c#L3063

static void session_handler_interface_gets_implemented(zend_class_entry *self, zend_class_entry *class) {
	if (!zend_hash_str_exists(&class->function_table, ZEND_STRL("create_sid"))
		&& !session_interfaces_include(class, php_session_id_iface_entry)) {
		zend_error(E_WARNING,
			"Class %s implementing SessionHandlerInterface is missing the create_sid() method which will be required in PHP 9.0",
			ZSTR_VAL(class->name));
	}
	if (!zend_hash_str_exists(&class->function_table, ZEND_STRL("validateid"))
		&& !session_interfaces_include(class, php_session_update_timestamp_iface_entry)) {
		zend_error(E_WARNING,
			"Class %s implementing SessionHandlerInterface is missing the validateId() method which will be required in PHP 9.0",
			ZSTR_VAL(class->name));
	}
}

Found this after a PHP 8.5 -> 8.6 upgrade with 3rd party software - tried to filter out deprecation notices but this is coming up as an E_WARNING instead - and it should not be

Simply changing the E_WARNING to a deprecation level should fix the issue - it's annoying!

PHP Version
PHP 8.6.0 (cli) (built: Nov 20 2026 15:07:19) (NTS)
Copyright © The PHP Group and Contributors
Built by Ubuntu
Zend Engine v4.6.0, Copyright © Zend by Perforce
    with Zend OPcache v8.6.0, Copyright ©, by Zend by Perforce
Operating System

No response

主要语言
C
星标
41.9k
派生
8.5k
平均合并
2 天 16 小时
30 天内合并 PR
116

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

php/php-src 的其他 Issue

查看 php/php-src 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。