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

Đang mở Phù hợp với người mới
#26,001 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, php
Lĩnh vực
backend

Hướng nghiên cứu

Issue trỏ đến ext/session/session.c, trong session_handler_interface_gets_implemented(). Đọc hai lần kiểm tra phương thức còn thiếu và tìm các chẩn đoán ở gần có mức độ deprecation để làm theo quy ước của dự án. Thay đổi mức cảnh báo cho các thông báo này, sau đó chạy các bài kiểm tra session liên quan và xác nhận việc thiếu create_sid() và validateId() sẽ tạo ra thông báo deprecation.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
C
Star
41.9k
Fork
8.5k
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
116

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của php/php-src

Tất cả issue của php/php-src

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.