Req #53111 [Opn->Bgs]: class_exists call __autoload every time on non existing classes
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
+Status: Bogus
Type: Feature/Change Request
Package: Performance problem
Operating System: Linux
PHP Version: 5.3.3
Block user comment: N
New Comment:
.
Previous Comments:
------------------------------------------------------------------------
[2010-10-21 11:51:43] johannes@php.net
That's expected. The autoload function might be non-deterministic.
------------------------------------------------------------------------
[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
Thread (3 messages)