# is_callable and method_exists always true when __call is defined

- Thread: https://externals.io/message/17203
- Original archive: https://news-web.php.net/php.internals/17203
- Started by Davey Shafik on 2005-07-09T04:08:03+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #17203 — Davey Shafik — 2005-07-09T04:08:03+00:00

URL: https://externals.io/message/17203#17203

Dear all,

I came across something when I found this bug 
(http://bugs.php.net/bug.php?id=33621).

Should `is_callable()` and `method_exists()` always return true when the 
method doesn't *really* exist? i.e. it would only be called via __call()

Is it possible to add an argument to make it only check "real" methods 
at the very least? Or some way to additionally distinguish between these
two things?

- Davey

---

## #17207 — Marcus Boerger — 2005-07-09T09:24:46+00:00

URL: https://externals.io/message/17203#17207 · In reply to: #17203

Hello Davey,

  if you ask me it is stupid to return true because __call exists since the
user can pretty easy do that by adding one more check. But he can in no way
query if the function really exists or not (well he can use reflection but
that is thousand times slower...)

regards
marcus

Saturday, July 9, 2005, 6:08:03 AM, you wrote:

> Dear all,

> I came across something when I found this bug 
> (http://bugs.php.net/bug.php?id=33621).

> Should `is_callable()` and `method_exists()` always return true when the 
> method doesn't *really* exist? i.e. it would only be called via __call()

> Is it possible to add an argument to make it only check "real" methods 
> at the very least? Or some way to additionally distinguish between these
> two things?

> - Davey




-- 
Best regards,
 Marcus                            mailto:mail@marcus-boerger.de

---

## #17208 — M. Sokolewicz — 2005-07-09T14:58:47+00:00

URL: https://externals.io/message/17203#17208 · In reply to: #17207

I would expect `is_callable()` to return true (since it is callable), but 
 `method_exists()` to return false (since it doesn't really exist, it's 
magic)... at least, that's what would make most sense to me...

Marcus Boerger wrote:
> Hello Davey,
> 
>   if you ask me it is stupid to return true because __call exists since the
> user can pretty easy do that by adding one more check. But he can in no way
> query if the function really exists or not (well he can use reflection but
> that is thousand times slower...)
> 
> regards
> marcus
> 
> Saturday, July 9, 2005, 6:08:03 AM, you wrote:
> 
> 
> > […]
> 
> 
> > […]
> 
> 
> > […]
> 
> 
> > […]
> 
> 
> > […]
