|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65144 Session user-level handler method of a class can't invoke class
Submitted: 2013-06-27 08:02 UTC Modified: 2013-10-15 11:54 UTC
From: hark110 at 163 dot com Assigned:
Status: No Feedback Package: APC (PECL)
PHP Version: 5.3.26 OS: Fedora 18 x86_64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
40 + 39 = ?
Subscribe to this entry?

 [2013-06-27 08:02 UTC] hark110 at 163 dot com
if use method of class A for set session_set_save_handler then invoke a method B1 of the other class B, in the method B1 will can't access constant and static property of the class B, and report error:
Fatal error: Access to undeclared static property
Fatal error: Undefined class constant 

Test script:
class B {

	const D = 'test';

	private $a = 'my test';
	static $s = 'my static';

	public function p() {


class A {
	const B = 3;
	var $s = null;
	public function __construct() {
		session_set_save_handler(array($this, 'open'), array($this, 'close'), array($this, 'read'), array($this, 'write'), array($this, 'destroy'), array($this, 'gc'));
	public function open() {
		$this->s = new B;
	public function start() {
	public function close() {

	public function read() {
	public function destroy() {
	public function gc() {
	public function write() {

$obj = new A;

Expected result:
report error

Actual result:
no error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-21 17:37 UTC]
-Status: Open +Status: Feedback
 [2013-07-21 17:37 UTC]
Can't reproduce with PHP 5.4.18-dev and APC 3.1.13.

PHP 5.3 is now security fixes only. Please try a PHP 5.4 snapshot.

Duped by #65276?
 [2013-10-15 11:54 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Nov 29 17:05:53 2022 UTC