php.net |  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hark110 at 163 dot com
New email:
PHP Version: OS:

 

 [2013-06-27 08:02 UTC] hark110 at 163 dot com
Description:
------------
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
or
Fatal error: Undefined class constant 




Test script:
---------------
<?php
class B {

	const D = 'test';

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

	public function p() {
		var_dump($this);
		var_dump($this->a);
		var_dump(self::$s);
		var_dump(self::D);
	}

}

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() {
		session_start();
	}
	public function close() {
	}

	public function read() {
	}
	public function destroy() {
	}
	public function gc() {
	}
	public function write() {
		$this->s->p();
	}
}

$obj = new A;
$obj->start();

Expected result:
----------------
report error

Actual result:
--------------
no error

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-21 17:37 UTC] arpad@php.net
-Status: Open +Status: Feedback
 [2013-07-21 17:37 UTC] arpad@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC