#50594 [Opn->Tbd]: method_exists() is invoking __autoload()
| From: | jani@php.net | Date: | Tue, 29 Dec 2009 11:41:30 +0000 |
| Subject: | #50594 [Opn->Tbd]: method_exists() is invoking __autoload() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3583@lists.php.net to get a copy of this message | ||
ID: 50594
Updated by: jani@php.net
Reported By: maros dot gajdosik at gmail dot com
-Status: Open
+Status: To be documented
-Bug Type: Class/Object related
+Bug Type: Documentation problem
PHP Version: 5.2.12
New Comment:
This is expected behaviour. Will need to be documented better.
Previous Comments:
------------------------------------------------------------------------
[2009-12-28 16:49:46] maros dot gajdosik at gmail dot com
Description:
------------
Function method_exists() is invoking __autoload(), which, in my
opinion,
is an unwanted behaviour. Sorry, if this has been posted already -
tried
to search for it without any results.
Reproduce code:
---------------
<?php // PHP file "my_class.php"
class my_class{
public $property = "I'm not a class name!";
}
?>
<?php // PHP file #2
function __autoload($class_name) {
echo 'Loading: '.$class_name.'<br />';
require_once $class_name.'.php';
}
$my_object = new my_class();
method_exists($my_object-> property, 'method');
?>
Expected result:
----------------
Loading: my_class
Loading: I am not a class name!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50594&edit=1