Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67415 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36938 invoked from network); 13 May 2013 08:19:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 May 2013 08:19:17 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:63406] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 92/E9-55400-A81A0915 for ; Mon, 13 May 2013 04:19:15 -0400 Received: from [192.168.2.20] (ppp-88-217-93-86.dynamic.mnet-online.de [88.217.93.86]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id CA3A16589C; Mon, 13 May 2013 10:17:11 +0200 (CEST) To: Ferenc Kovacs Cc: pierre@pcservice.co.za, Oleku Konko , "php-internals@lists.php.net" , PHP Development , Nikita Popov In-Reply-To: References: <1367681473.95445.YahooMailNeo@web120904.mail.ne1.yahoo.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 13 May 2013 10:18:25 +0200 Message-ID: <1368433105.2431.71.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Scalar Type Casting Magic Methods From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Wed, 2013-05-08 at 10:42 +0200, Ferenc Kovacs wrote: > 2013.05.08. 7:38, "Pierre du Plessis" ezt írta: > > > > The __toArray can be useful if you want to perform array functions on the > > object (E.G array_filter), otherwise I think it would be very useful if > > the This can't work. Consider Which method will be called? > > array functions can accept an object implementing ArrayAccess as well > > instead of just an array > > yeah, I also think that ArrayObjects should be accepted where array is > expected. Patches are certainly welcome, but be sure to get to every place, else it becomes an inconsistent mess :) Oh, and be consistent about return values of operations ... oh, and will $result = some_array_operation(new ArrayObject); return an array or instance of ArrayObject, if the later how will it be instantiated ... do we have to pass result factories or something to all of those? johannes