Re: Ability to assign new object to a class property.
| From: | Stas Malyshev | Date: | Sat, 14 Apr 2012 20:37:25 +0000 |
| Subject: | Re: Ability to assign new object to a class property. | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-59934@lists.php.net to get a copy of this message | ||
Hi!
> It's convenient to assign an empty array to a property in this manner.
>
> private $storage = array();
>
> So why not
> private $storage = new ArrayObject();
array is a static constant. Objects have complex behavior. So it's
better to handle this in ctor. I see no value in splitting ctor into
multiple pieces, and debugging such thing would be a nightmare.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227