note 101507 added to function.method-exists
| From: | phoenix at todofixthis dot com | Date: | Tue, 21 Dec 2010 17:13:51 +0000 |
| Subject: | note 101507 added to function.method-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175109@lists.php.net to get a copy of this message | ||
As noted at http://php.net/is-callable#100237
method_exists() does not care about the existence of __call(), whereas is_callable() does:
<?php
class Test {
public function explicit( ) {
// ...
}
public function __call( $meth, $args ) {
// ...
}
}
$Tester = new Test();
var_export(method_exists($Tester, 'anything')); // false
var_export(is_callable(array($Tester, 'anything'))); // true
----
Server IP: 64.71.164.2
Probable Submitter: 12.151.187.1
----
Manual Page -- http://www.php.net/manual/en/function.method-exists.php
Edit -- https://master.php.net/note/edit/101507
Del: integrated -- https://master.php.net/note/delete/101507/integrated
Del: useless -- https://master.php.net/note/delete/101507/useless
Del: bad code -- https://master.php.net/note/delete/101507/bad+code
Del: spam -- https://master.php.net/note/delete/101507/spam
Del: non-english -- https://master.php.net/note/delete/101507/non-english
Del: in docs -- https://master.php.net/note/delete/101507/in+docs
Del: other reasons-- https://master.php.net/note/delete/101507
Reject -- https://master.php.net/note/reject/101507
Search -- https://master.php.net/manage/user-notes.php