Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43325 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93664 invoked from network); 11 Mar 2009 22:40:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2009 22:40:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=webmaster@ajeux.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=webmaster@ajeux.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ajeux.com from 209.85.219.169 cause and error) X-PHP-List-Original-Sender: webmaster@ajeux.com X-Host-Fingerprint: 209.85.219.169 mail-ew0-f169.google.com Received: from [209.85.219.169] ([209.85.219.169:53936] helo=mail-ew0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/91-09289-8ED38B94 for ; Wed, 11 Mar 2009 17:40:43 -0500 Received: by ewy17 with SMTP id 17so202405ewy.23 for ; Wed, 11 Mar 2009 15:40:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.8.209 with SMTP id 59mr3733171wer.18.1236811237733; Wed, 11 Mar 2009 15:40:37 -0700 (PDT) Reply-To: olivier@ajeux.com In-Reply-To: <7dd2dc0b0903111512g798af3fco66141a925508b4fd@mail.gmail.com> References: <7dd2dc0b0903111512g798af3fco66141a925508b4fd@mail.gmail.com> Date: Wed, 11 Mar 2009 23:40:37 +0100 Message-ID: To: Nathan Nobbe Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=0016364c749b7ab74e0464df8e3e Subject: Re: [PHP-DEV] non static function called as static one From: webmaster@ajeux.com (Olivier Doucet) --0016364c749b7ab74e0464df8e3e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, > not sure if this was mentioned on the general list but, i believe what > youre describing is documented in the manual under php5 classes/objects -> > "the basics": > > http://www.php.net/manual/en/language.oop5.basic.php > > $this is a reference to the calling object (usually the object to which > the method belongs, but can be another object, if the method is called > statically from > the context of a secondary object). > > -nathan > I know this behaviour is fully documented, but I was more concerned about "is it a 'normal' behaviour ?". How can a programmer controls the class he wrote, and make it absolutely bugproof ? How can he detect his function was called in a static context and forbid it (or write specific code for) ? Olivier --0016364c749b7ab74e0464df8e3e--