#50594 [Csd]: method_exists() is invoking __autoload()
| From: | maros dot gajdosik at gmail dot com | Date: | Wed, 30 Dec 2009 22:56:27 +0000 |
| Subject: | #50594 [Csd]: method_exists() is invoking __autoload() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3590@lists.php.net to get a copy of this message | ||
ID: 50594
User updated by: maros dot gajdosik at gmail dot com
Reported By: maros dot gajdosik at gmail dot com
Status: Closed
Bug Type: Documentation problem
PHP Version: 5.2.12
New Comment:
I am glad to help even a tiny bit.
Previous Comments:
------------------------------------------------------------------------
[2009-12-30 12:24:58] rquadling@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
------------------------------------------------------------------------
[2009-12-30 12:24:43] svn@php.net
Automatic comment from SVN on behalf of rquadling
Revision: http://svn.php.net/viewvc/?view=revision&revision=292800
Log: method_exists() and property-exists() both call __autoload if
class is not known.
Fix #50594
------------------------------------------------------------------------
[2009-12-29 11:41:30] jani@php.net
This is expected behaviour. Will need to be documented better.
------------------------------------------------------------------------
[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