I always wondered why can't we do something like this in php

class MyClass{

private $storage = new ArrayObject();

public function __construct($v){
// whatever 
}

// rest of class

}

Why can't we create a new object and assign it to property like this?

Then when a new instance of MyClass is created the $storage variable is
automatically assigned a new ArrayObject.
Somethink like this is valid, possible and commonly used in Java, why not in
php?

Has anyone already asked for this to be valid syntax in php?

Dmitri Snytkine
Web Developer
Ultra Logistics, Inc.
Phone: (888) 220-4640 x 2097
Fax: (888) 795-6642
E-Mail: dsnytk...@ultralogistics.com
Web: www.ultralogistics.com

"A Top 100 Logistics I.T. Provider in 2011"




-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to