Bug #53141 [Opn->Fbk]: autoload misbehaves if called from closing session

From: Date: Sat, 23 Oct 2010 14:55:02 +0000
Subject: Bug #53141 [Opn->Fbk]: autoload misbehaves if called from closing session
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-155461@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53141&edit=1

 ID:                 53141
 Updated by:         felipe@php.net
 Reported by:        ladislav at marek dot su
 Summary:            autoload misbehaves if called from closing session
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            SPL related
 Operating System:   GNU Linux
 PHP Version:        5.3SVN-2010-10-23 (SVN)
 Block user comment: N

 New Comment:

I got the expected result when testing on the 5.3 SVN version. Are you
actually using the lastest SVN version?


Previous Comments:
------------------------------------------------------------------------
[2010-10-23 10:36:09] ladislav at marek dot su

Description:
------------
SPL autoload triggers fatal error if is called from currently closing
session. 
With __autoload function scripts works fine.

Test script:
---------------
spl_autoload_register(function ($class) {
    var_dump("Loading $class");
    eval('class Bar {}');
});

class Foo
{
    function __sleep()
    {
        new Bar;
        return array();
    }
}

session_start();
$_SESSION['foo'] = new Foo;

Expected result:
----------------
string(11) "Loading Bar"

Actual result:
--------------
Fatal error: spl_autoload(): Class Bar could not be loaded in 
/var/www/hosts/tests.l/index.php on line 14


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53141&edit=1


Thread (10 messages)

« previous php.bugs (#155461) next »