Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59934 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6477 invoked from network); 14 Apr 2012 20:37:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2012 20:37:28 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.153 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.153 smtp153.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.153] ([67.192.241.153:38504] helo=smtp153.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/62-33137-800E98F4 for ; Sat, 14 Apr 2012 16:37:28 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp5.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 2CB865804C; Sat, 14 Apr 2012 16:37:26 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp5.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id BF9E458049; Sat, 14 Apr 2012 16:37:25 -0400 (EDT) Message-ID: <4F89E005.3030409@sugarcrm.com> Date: Sat, 14 Apr 2012 13:37:25 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Dmitri Snytkine CC: 'Anthony Ferrara' , 'PHP Internals' References: <01ed01cd19aa$58810e80$09832b80$@alliantinternet.com> <4F888746.4050705@sugarcrm.com> <4F88BFDB.3030004@alliantinternet.com> <01fb01cd1a36$8df14d50$a9d3e7f0$@alliantinternet.com> In-Reply-To: <01fb01cd1a36$8df14d50$a9d3e7f0$@alliantinternet.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Ability to assign new object to a class property. From: smalyshev@sugarcrm.com (Stas Malyshev) 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