Re: Unexpected "silent" type-cast with initialized but un-set members

From: Date: Thu, 16 Feb 2006 11:39:39 +0000
Subject: Re: Unexpected "silent" type-cast with initialized but un-set members
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-21878@lists.php.net to get a copy of this message
On 16.02.2006 14:32, Morten Fangel wrote:
Hi, Look at the following example: --- <?php 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
        )
) ---
<?php $a->bar = 1; var_dump($a); ?> This code is much simpler, huh? -- Wbr, Antony Dovgal

« previous php.internals (#21878) next »