Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49195 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45939 invoked from network); 3 Aug 2010 11:15:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2010 11:15:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=crocodile2u@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=crocodile2u@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: crocodile2u@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:41120] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/A4-16995-A5AF75C4 for ; Tue, 03 Aug 2010 07:15:38 -0400 Received: by qyk36 with SMTP id 36so781937qyk.8 for ; Tue, 03 Aug 2010 04:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=XcrqFKSEvIRpQhyPOW5knr+W4x0XkAmhWvsc7M5ZP6k=; b=lqb3ZABhIH1BJAQrDFBCBKm9oaoayE/KXJ899HuhT8Qr9srlPFtbQSKy3fgSUz/OFg QmlBYtM9hVAulAh5h86OfxCLU9rJYXL8pLwteuV7SoOg+FXEgSlomm7KY6O+1bgRWgqa IXA1C3y3ajmUISuFPHEyDHYdHZ3Zl+ixR3Oag= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=DxikRuz/TxoiRd85wvOg3dEF11s8f8s2+srotYdO/tal+bF931JKIyBoU0bZ3SkIOy +WHwQ4gkAKUGo1Eodbtyqdq/tMyrlGCM2jbrAjwWrtOUCuBSgHvu1Sir72MOHFmutYjo YosFX5Y6kAU6iSV++ARCUlBTSLszeK65yDSqY= MIME-Version: 1.0 Received: by 10.224.27.104 with SMTP id h40mr2518509qac.125.1280834135477; Tue, 03 Aug 2010 04:15:35 -0700 (PDT) Received: by 10.229.230.146 with HTTP; Tue, 3 Aug 2010 04:15:35 -0700 (PDT) In-Reply-To: <9EC2A53FAB8D4BEAA7973FD5765BE428@sinahp> References: <9EC2A53FAB8D4BEAA7973FD5765BE428@sinahp> Date: Tue, 3 Aug 2010 15:15:35 +0400 Message-ID: To: Shijiang Cc: PHP internals Content-Type: multipart/alternative; boundary=00c09f899714a94f43048ce96fb5 Subject: Re: [PHP-DEV] Confusing performance of the magic method __call From: crocodile2u@gmail.com (Victor Bolshov) --00c09f899714a94f43048ce96fb5 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Shijiang, did you notice the -- Warning: The magic method __call() must have public visibility and cannot b= e static in Command line code on line 1 -- ??? 2010/8/3 Shijiang > Hi, > > In the following sample code, I expected that the magic method __call onl= y > works within the class Test. > But it seems that the access control keyword private lost its efficacy wh= en > working together with the magic method __call. > > class Test{ > private function __call($name,$params){ > echo $name,"\n"; > echo $params[0]; > } > > public function bar(){ > $this->kakaka('afaafaf'); > } > } > $foo=3Dnew 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 th= e > visibility rules. > > Cheers. > --=20 =F3 =D5=D7=C1=D6=C5=CE=C9=C5=CD, =F7=C9=CB=D4=CF=D2 --00c09f899714a94f43048ce96fb5--