Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49197 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53032 invoked from network); 3 Aug 2010 11:54:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2010 11:54:57 -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.212.42 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.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:36493] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/06-16995-093085C4 for ; Tue, 03 Aug 2010 07:54:57 -0400 Received: by vws18 with SMTP id 18so3119668vws.29 for ; Tue, 03 Aug 2010 04:54:54 -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=tR0zIwRGW4BFOKUvCchV59n3qh+jRG8+qTARHiAKKEU=; b=jD92aJFTjj9hyXiA1QQ/rQh44Qm6bKJPLt9p3BlsL8eS4pjuPCXey/+kWP8SqnboEJ jMIKEWTNMsV4Cy4z+3Vp8MOL4hhVuIaC8sTx1NODkahH/ttGXvxe4FXCz4aGtPgRhU4B JdWSK99uRiIl7PuQrTlpYiO/2/XqEKJx91AKM= 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=u9TRVZpJ2ADAfhYASwDuZ+YWLU2WnaaLa2vZgLayAEmpjnvDSwooxn71P5PWTcqJ7t vOpEZbJaZYLdCgKyUXiEjCh1gpQYxApACztIa5KIr77twHGAijmoexm1FYUex7ZOHGed 8Fs+33F5juzp+aRwJVkoU7XZSJWLJAN4D3zSw= MIME-Version: 1.0 Received: by 10.229.251.134 with SMTP id ms6mr1035223qcb.55.1280836494482; Tue, 03 Aug 2010 04:54:54 -0700 (PDT) Received: by 10.229.230.146 with HTTP; Tue, 3 Aug 2010 04:54:54 -0700 (PDT) In-Reply-To: References: <9EC2A53FAB8D4BEAA7973FD5765BE428@sinahp> Date: Tue, 3 Aug 2010 15:54:54 +0400 Message-ID: To: Ferenc Kovacs Cc: Shijiang , PHP internals Content-Type: multipart/alternative; boundary=0016363b8dea44dce2048ce9fc9e Subject: Re: [PHP-DEV] Confusing performance of the magic method __call From: crocodile2u@gmail.com (Victor Bolshov) --0016363b8dea44dce2048ce9fc9e Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Yes, sorry. I've been working with 5.3 for pretty long time so I found the original letter a bit strange. 2010/8/3 Ferenc Kovacs > 2010/8/3 Victor Bolshov : > > Shijiang, did you notice the > > > > -- > > Warning: The magic method __call() must have public visibility and cann= ot > be > > 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 > 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. > >> > >> >> 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 > the > >> visibility rules. > >> > >> Cheers. > >> > > > > > > > > -- > > =F3 =D5=D7=C1=D6=C5=CE=C9=C5=CD, > > =F7=C9=CB=D4=CF=D2 > > > > It was added/changed with 5.3 so it is not necessarly obvious. > > Tyrael > --=20 =F3 =D5=D7=C1=D6=C5=CE=C9=C5=CD, =F7=C9=CB=D4=CF=D2 --0016363b8dea44dce2048ce9fc9e--