Req #53111 [Opn]: class_exists call __autoload every time on non existing classes
| From: | johannes@php.net | Date: | Thu, 21 Oct 2010 09:51:43 +0000 |
| Subject: | Req #53111 [Opn]: class_exists call __autoload every time on non existing classes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-155395@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53111&edit=1
ID: 53111
Updated by: johannes@php.net
Reported by: gmblar+php at gmail dot com
Summary: class_exists call __autoload every time on non
existing classes
Status: Open
Type: Feature/Change Request
Package: Performance problem
Operating System: Linux
PHP Version: 5.3.3
Block user comment: N
New Comment:
That's expected. The autoload function might be non-deterministic.
Previous Comments:
------------------------------------------------------------------------
[2010-10-20 12:10:08] gmblar+php at gmail dot com
Description:
------------
class_exists call __autoload every time on non existing classes
Test script:
---------------
<?php
header('Content-Type: text/plain');
function __autoload($class) {
var_dump('Autoload '.$class);
}
for($a=0; $a<10; $a++) {
$status = class_exists('foobar');
var_dump($status);
}
?>
Expected result:
----------------
string(15) "Autoload foobar"
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
Actual result:
--------------
string(15) "Autoload foobar"
bool(false)
string(15) "Autoload foobar"
bool(false)
string(15) "Autoload foobar"
bool(false)
string(15) "Autoload foobar"
bool(false)
string(15) "Autoload foobar"
bool(false)
string(15) "Autoload foobar"
bool(false)
string(15) "Autoload foobar"
bool(false)
string(15) "Autoload foobar"
bool(false)
string(15) "Autoload foobar"
bool(false)
string(15) "Autoload foobar"
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53111&edit=1