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

オープン 初心者向け
#26,001 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c, php
領域
backend

調査の方向性

issue は ext/session/session.c の session_handler_interface_gets_implemented() を指しています。欠落しているメソッドの2つのチェックを読み、プロジェクトの慣例に従うため、近くにある同様の 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時間
マージ済み PR(30日)
116

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

php/php-src のほかの issue

php/php-src の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。