ID:               50427
 Updated by:       [email protected]
 Reported By:      omri dot rules at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: Windows XP
 PHP Version:      5.3.1
 New Comment:

Please read: http://php.net/manual/en/language.oop5.properties.php




Previous Comments:
------------------------------------------------------------------------

[2009-12-09 15:39:21] omri dot rules at gmail dot com

Description:
------------
I've tried to predefine a variable inside a class as an instance of
another class.
The result was a parse error.

Reproduce code:
---------------
<?php
class Foo {
        public $var = 1;
}

class Bar {
        public $obj = new Foo;
        public function __construct() {
                echo $this->obj->var;
        }
}
$a = new Bar;
?>

Expected result:
----------------
1

Actual result:
--------------
Parse error: parse error in C:\wamp\www\try.php on line 7


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50427&edit=1

Reply via email to