Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40177 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75813 invoked from network); 30 Aug 2008 23:17:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2008 23:17:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=dafneves@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dafneves@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.166.179 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: dafneves@gmail.com X-Host-Fingerprint: 64.233.166.179 py-out-1112.google.com Received: from [64.233.166.179] ([64.233.166.179:11921] helo=py-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/B5-27196-915D9B84 for ; Sat, 30 Aug 2008 19:17:45 -0400 Received: by py-out-1112.google.com with SMTP id a25so777568pyi.16 for ; Sat, 30 Aug 2008 16:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=0kf1BNjQAApcOK6mmc+itw7oheSefdhq/xooMF7UhOM=; b=gkgA/MVxOkKlYEF06tBn3P9E/QwhXrHAdSs6XEwwdT2NoZj7hYUKXAT8CUo9J0NVcM ngfmB4zgtBeTn70m7xBCgkpa8SplxfcKpfXAuWEnuSfT6ft8E8nv9lqgnd6HME5UaWL2 SDwYuswc7FbGt2HaXywbwAxcPmy1E1nsIl9FU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=eS/yBMcn3XO5aU56QlboM6aXgcEE9f8ATPj7v+XM+wed9B2VuBm6GJfLNJSmfGj0ci SI934peiqtQi7KZUvbct1jAM6BC57iO7LBsAEvWPwd8WTsyB9iKQ4Cht0tZvct0pFJAa gl5IBhx4g0Y+l4ulqvNZytAZW726O3C4MuLlw= Received: by 10.64.232.9 with SMTP id e9mr8852079qbh.84.1220138261677; Sat, 30 Aug 2008 16:17:41 -0700 (PDT) Received: by 10.65.242.4 with HTTP; Sat, 30 Aug 2008 16:17:41 -0700 (PDT) Message-ID: <87ae45950808301617m74ab0b61i935a1bad31c09b48@mail.gmail.com> Date: Sun, 31 Aug 2008 00:17:41 +0100 To: "Antony Dovgal" Cc: internals@lists.php.net In-Reply-To: <48B9D1EC.2080101@daylessday.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87ae45950808301302o24f164daj4377a360f3ed1a2c@mail.gmail.com> <48B9B3F8.2060409@suse.de> <48B9B55A.6050707@lerdorf.com> <87ae45950808301550n392cee6ft245c7be188b30e7b@mail.gmail.com> <48B9D1EC.2080101@daylessday.org> Subject: Re: [PHP-DEV] __call() magic method From: dafneves@gmail.com ("Diogo Neves") Hi again, On Sun, Aug 31, 2008 at 12:04 AM, Antony Dovgal wrote: > On 31.08.2008 02:50, Diogo Neves wrote: >> >> Exactly... >> >> Is that normal workings or more like a bugie one? > > Definitely not a bug. Ok, it's implemented to work like that... less bad ;) > > I believe the reason is that if you enable __call() in this case, you'd have > different behavior depending on the calling scope, i.e. complete mess. Well, if things don't behave diferent depending on scope then why private exists anyway? And the scope is being controlled already, that's why i get an fatal error, right? If the method is private, why it simple don't "think" it doesn't exist when outside of class scope? Maybe it don't make sense but... class foo { private function bar() { } function __call($f,$a) { echo "called $f"; } } $a = new foo; // There ( ouside the class scope ) ... // ... this exist as much ... $a->bar(); // ... as this, right? $a->bar1(); Even if it looks like a mess... it makes some sense, no? Unless u say me that a class isn't a scope because I never understood the php scopes, maybe u can recomend me a good article about it or some link somewhere > Also there would be no way to know you're calling a method you're not > supposed to call (unless you trigger an error yourself). > > -- > Wbr, Antony Dovgal > -- Thanks by your attention, Diogo Neves Web Developer @ SAPO.pt by PrimeIT.pt