Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61372 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82264 invoked from network); 17 Jul 2012 17:50:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2012 17:50:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.163 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.163 smtp163.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.163] ([67.192.241.163:37298] helo=smtp163.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/75-54353-8E5A5005 for ; Tue, 17 Jul 2012 13:50:32 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp6.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 8F8752706EF; Tue, 17 Jul 2012 13:50:29 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp6.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 0463C270BE5; Tue, 17 Jul 2012 13:50:28 -0400 (EDT) Message-ID: <5005A5E4.2030004@sugarcrm.com> Date: Tue, 17 Jul 2012 10:50:28 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Alexey Zakhlestin CC: Pierre Joye , Gustavo Lopes , internals , Andrew Faulds References: <50059AF8.5050805@sugarcrm.com> <9430CE0C-7DA4-4655-92D5-056E12A7BC74@gmail.com> In-Reply-To: <9430CE0C-7DA4-4655-92D5-056E12A7BC74@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I am for making array a proper class with methods. > > "Legacy" functions can be implemented as wrappers around it: > > function array_push(&$array, $value) > { > $array->push($value); > } The problem there is that array has different semantics than object. Not completely, but for example if you pass array to function, it is passed by value and is not modified, but objects are always mutable when passed to functions. Changing this semantics will break a lot of code. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227