|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-07-21 16:53 UTC] arpad@php.net
-Status: Open
+Status: Feedback
[2013-07-21 16:53 UTC] arpad@php.net
[2013-10-15 11:54 UTC] pecl-dev at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 20 17:00:01 2025 UTC |
Description: ------------ if class A be registered session handler , and the session handler class A is invoked other class B, and the class B has static property, when be invoked method of class B that used the static property, class not defined error be report Test script: --------------- <?php class B { const D = 'test'; private $a = 'my test'; static $s = 'my static'; public function p() { 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: ---------------- above code not var_dump string after be the second executed report self::D undefined and B::$s is same Actual result: -------------- var_dump self::D is "test", and B::$s is 'my static';