Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21878 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46462 invoked by uid 1010); 16 Feb 2006 11:39:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46447 invoked from network); 16 Feb 2006 11:39:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2006 11:39:46 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:11000] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 6F/60-39287-18464F34 for ; Thu, 16 Feb 2006 06:39:46 -0500 Received: (qmail 23329 invoked from network); 16 Feb 2006 11:39:41 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 16 Feb 2006 11:39:41 -0000 Message-ID: <43F4647B.9030506@zend.com> Date: Thu, 16 Feb 2006 14:39:39 +0300 User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: fangel@nable.dk CC: php internals References: <200602161232.48780.fangel@nable.dk> In-Reply-To: <200602161232.48780.fangel@nable.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Unexpected "silent" type-cast with initialized but un-set members From: antony@zend.com (Antony Dovgal) On 16.02.2006 14:32, Morten Fangel wrote: > Hi, > > Look at the following example: > --- > class Foo { > public $bar; > function __construct() { > $this->bar->baz = 'blah'; > } > } > $foo = new Foo(); > print_r($foo); > ?> > -- > > It results in: > --- > Foo Object > ( > [bar] => stdClass Object > ( > [baz] => blah > ) > ) > --- bar = 1; var_dump($a); ?> This code is much simpler, huh? -- Wbr, Antony Dovgal