method_exists() always return TRUE if __call method exists
[2005-03-23 14:43 UTC] pasha dot zubkov at gmail dot com
Description:
------------
See example. I can't use `if (method_exists()) {}` because it always return TRUE
Reproduce code:
---------------
<?php
class TestClass {
public function __construct() {
var_dump(method_exists($this, 'test'));
if (method_exists($this, 'test')) {
$this->test();
}
}
public function __call($name, $args) {
throw new Exception('Call to undefined method '.get_class($this).'::'.$name.'()');
}
}
try {
$test = new TestClass;
} catch (Exception $e) {
exit($e->getMessage());
}
?>
Expected result:
----------------
bool(false)
Actual result:
--------------
bool(true) Call to undefined method TestClass::test()
[2005-03-24 14:20 UTC] pasha dot zubkov at gmail dot com
[2005-03-29 07:49 UTC] pasha dot zubkov at gmail dot com