Bug #53141 [NEW]: autoload misbehaves if called from closing session

From: Date: Sat, 23 Oct 2010 08:36:13 +0000
Subject: Bug #53141 [NEW]: autoload misbehaves if called from closing session
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-155455@lists.php.net to get a copy of this message
From:             
Operating system: GNU Linux
PHP version:      5.3SVN-2010-10-23 (SVN)
Package:          SPL related
Bug Type:         Bug
Bug description:autoload misbehaves if called from closing session

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 bug report at http://bugs.php.net/bug.php?id=53141&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=53141&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=53141&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=53141&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=53141&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53141&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=53141&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=53141&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=53141&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=53141&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=53141&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=53141&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=53141&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=53141&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=53141&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53141&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53141&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=53141&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=53141&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=53141&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=53141&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=53141&r=mysqlcfg



Thread (10 messages)

« previous php.bugs (#155455) next »