Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49193 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43421 invoked from network); 3 Aug 2010 11:10:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2010 11:10:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=shijiang@staff.sina.com.cn; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=shijiang@staff.sina.com.cn; sender-id=unknown Received-SPF: error (pb1.pair.com: domain staff.sina.com.cn from 61.135.152.204 cause and error) X-PHP-List-Original-Sender: shijiang@staff.sina.com.cn X-Host-Fingerprint: 61.135.152.204 staff-jes1.sina.com.cn Linux 2.4/2.6 Received: from [61.135.152.204] ([61.135.152.204:44628] helo=staff-jes1.sina.com.cn) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/14-16995-A09F75C4 for ; Tue, 03 Aug 2010 07:10:05 -0400 Received: from sinahp ([10.217.12.94]) by staff-jes1.sina.com.cn (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005)) with ESMTPA id <0L6K009HRPODDUI0@staff-jes1.sina.com.cn> for internals@lists.php.net; Tue, 03 Aug 2010 19:09:58 +0800 (CST) Date: Tue, 03 Aug 2010 19:09:46 +0800 To: PHP internals Message-ID: <9EC2A53FAB8D4BEAA7973FD5765BE428@sinahp> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Mailer: Microsoft Outlook Express 6.00.2900.5931 Content-type: multipart/alternative; boundary="Boundary_(ID_h/TkeMlxtOQFddGxuYneDg)" X-Priority: 3 X-MSMail-priority: Normal Subject: Confusing performance of the magic method __call From: shijiang@staff.sina.com.cn (Shijiang) --Boundary_(ID_h/TkeMlxtOQFddGxuYneDg) Content-type: text/plain; charset=gb2312 Content-transfer-encoding: 7BIT Hi, In the following sample code, I expected that the magic method __call only works within the class Test. But it seems that the access control keyword private lost its efficacy when working together with the magic method __call. kakaka('afaafaf'); } } $foo=new Test; $foo->bar('sfsfss'); $foo->nothing('works'); // this also works without any errors. ?> IMHO, since the function __call is a method of a class, it should obey the visibility rules. Cheers. --Boundary_(ID_h/TkeMlxtOQFddGxuYneDg)--