Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23214 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36399 invoked by uid 1010); 9 May 2006 10:59:35 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36384 invoked from network); 9 May 2006 10:59:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 May 2006 10:59:35 -0000 X-PHP-List-Original-Sender: tobias@schlitt.info X-Host-Fingerprint: 87.106.7.192 hartes-php.de Linux 2.5 (sometimes 2.4) (4) Received: from ([87.106.7.192:37524] helo=schlitt.info) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 7E/18-63885-61670644 for ; Tue, 09 May 2006 06:59:35 -0400 Received: (qmail 9033 invoked by uid 210); 9 May 2006 13:04:44 +0200 Received: from 129.217.139.227 by hartes-php.de (envelope-from , uid 201) with qmail-scanner-1.25st (clamdscan: 0.88.2/1451. spamassassin: 3.1.1. perlscan: 1.25st. Clear:RC:1(129.217.139.227):. Processed in 0.045762 secs); 09 May 2006 11:04:44 -0000 Received: from vpn227.hrz.uni-dortmund.de (HELO ?129.217.139.227?) (tobias@schlitt.info@129.217.139.227) by hartes-php.de with ESMTPA; 9 May 2006 13:04:44 +0200 Message-ID: <44607553.5090509@schlitt.info> Date: Tue, 09 May 2006 12:56:19 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041124 Thunderbird/0.9 Mnenhy/0.6.0.104 MIME-Version: 1.0 To: Marcus Boerger CC: PHP Developers Mailing List X-Enigmail-Version: 0.93.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: array type hint and SPL array interfaces From: tobias@schlitt.info (Tobias Schlitt) Hi Marcus! I wondered, why PHP complains, if you have an array type hint in a method prototype and provide an object to this method, that implements the SPL interfaces to use objects as arrays. I would expect that, if an object can be handled exactly like an array, PHP should not complain, since the implementation of the method would not notice the difference. Or am I wrong? Regards, Toby -- Tobias Schlitt - Zend Certified Engineer NEW GPG Key: 0xC462BC14 a passion for php http://www.schlitt.info Like to say "thank you"? - http://pear.php.net/wishlist.php/toby