Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31734 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42385 invoked by uid 1010); 20 Aug 2007 11:15:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 42370 invoked from network); 20 Aug 2007 11:15:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Aug 2007 11:15:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=scott@macvicar.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=scott@macvicar.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain macvicar.net from 72.36.186.210 cause and error) X-PHP-List-Original-Sender: scott@macvicar.net X-Host-Fingerprint: 72.36.186.210 midden.org.uk Received: from [72.36.186.210] ([72.36.186.210:46924] helo=lovelace.midden.org.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 70/C2-23817-3E779C64 for ; Mon, 20 Aug 2007 07:15:49 -0400 Received: from office.vbulletin.com ([217.155.246.60] helo=[10.0.0.116]) by lovelace.midden.org.uk with esmtp (Exim 4.63) (envelope-from ) id 1IN5EU-0003Ln-J1; Mon, 20 Aug 2007 12:15:42 +0100 Message-ID: <46C977D5.6020509@macvicar.net> Date: Mon, 20 Aug 2007 12:15:33 +0100 User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Jakub Vrana CC: internals@lists.php.net References: <732091812.20070820122042@vrana.cz> In-Reply-To: <732091812.20070820122042@vrana.cz> X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Undefined property notice From: scott@macvicar.net (Scott MacVicar) I had always assumed this was down to the use of __set class foo { function __set($var, $value) { } } $o = new foo; $o->b = $o->b + 5; $o->c += 5; Displays the exact same properties. Scott Jakub Vrana wrote: > PHP have the Undefined variable/property notice to inform a programmer > about using uninitialized variables/properties. While both $b = $b + 5 > and $c += 5 issues the notice (and also $a["b"] = $a["b"] + 5 and > $a["c"] += 5 in case of arrays), in case of objects only $o->b = $o->b + 5 > issues the notice but $o->c += 5 not. Shouldn't be the notice issued > also with $o->c += 5? It is clearly usage of an undefined property. > > Jakub Vrana >