Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17208 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44996 invoked by uid 1010); 9 Jul 2005 14:58:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 44981 invoked from network); 9 Jul 2005 14:58:57 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 9 Jul 2005 14:58:57 -0000 X-Host-Fingerprint: 62.131.2.67 ip3e830243.speed.planet.nl Received: from ([62.131.2.67:29237] helo=localhost.localdomain) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id D7/1F-59389-926EFC24 for ; Sat, 09 Jul 2005 10:58:49 -0400 To: internals@lists.php.net,Marcus Boerger Message-ID: <42CFE627.8060900@php.net> Date: Sat, 09 Jul 2005 16:58:47 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050319 X-Accept-Language: en-us, en MIME-Version: 1.0 CC: Davey Shafik References: <39.71.59389.9AD4FC24@pb1.pair.com> <338389378.20050709112446@marcus-boerger.de> In-Reply-To: <338389378.20050709112446@marcus-boerger.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 62.131.2.67 Subject: Re: [PHP-DEV] is_callable and method_exists always true when __call is defined From: tularis@php.net ("M. Sokolewicz") 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: > > >>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 > > > > >