Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61358 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56351 invoked from network); 17 Jul 2012 15:06:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2012 15:06:12 -0000 Authentication-Results: pb1.pair.com header.from=ajfweb@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajfweb@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: ajfweb@googlemail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:53136] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/20-54353-46F75005 for ; Tue, 17 Jul 2012 11:06:12 -0400 Received: by weyr1 with SMTP id r1so384754wey.29 for ; Tue, 17 Jul 2012 08:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=WNGNEKFIsjtmxeU1viIpx85fcA2u0JIXFm2K+XrH5ag=; b=y6rM5Q2bh3q04Wi/HZ796RifWv9i4+xQCBm6wFKCwEloyf7la32eVF5ILeYMJyR8hy SUf0tknyVcht2RVxHCXFLIeAj4JmKnVEq/EeX5cyyaNabE9hbeaMCTi9mlyLt/FIDq9P FNOxXIKVvtZ/coP5k/k2KNQbvagfiQhJPvEuPKvM4HbiwyssutdbDJMxXb/CQ8pDn16w r7/iSDzenF+sXfAAmEUl9NIn/BIFn9zNkKeXiQhcv38lDwBSx+/r8ZL1VktHZLuAFmtB BNEchAmt7Bnb4wF3WMysabBqsTiV2PGyyxJox1O3Qn1XrOuIbBxkm5bfBT/6LOCKw6kH oc+Q== MIME-Version: 1.0 Received: by 10.216.240.196 with SMTP id e46mr93873wer.224.1342537569495; Tue, 17 Jul 2012 08:06:09 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Tue, 17 Jul 2012 08:06:09 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Tue, 17 Jul 2012 08:06:09 -0700 (PDT) In-Reply-To: <500570D1.9050708@lerdorf.com> References: <500570D1.9050708@lerdorf.com> Date: Tue, 17 Jul 2012 16:06:09 +0100 Message-ID: To: Rasmus Lerdorf Cc: Pierre Joye , internals , Gustavo Lopes Content-Type: multipart/alternative; boundary=e0cb4e43cff1ed6c2c04c507e24f Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: ajfweb@googlemail.com (Andrew Faulds) --e0cb4e43cff1ed6c2c04c507e24f Content-Type: text/plain; charset=UTF-8 Whilst weak typing has its benefits, I think typing is a little too weak in places. IMO "" should not be equal to 0 or coercable to 0. But of course "0" should equal 0. On Jul 17, 2012 3:04 PM, "Rasmus Lerdorf" wrote: > On 07/17/2012 03:07 AM, Pierre Joye wrote: > > hi, > > > > On Tue, Jul 17, 2012 at 2:12 AM, Gustavo Lopes > wrote: > > > >> Let's ignore empty arguments like "make[s] PHP feel modern". That > aside, the > >> main argument advanced in this message makes no sense. > > > > This idea has been proposed many times in the past and it is actually > > a very good proposal, for array, string or other types. > > > > The only reason why it is not yet implemented is the technical > > complexity to do it. We need pseudo objects and the likes, and it is > > really not something easy to do, in an efficient enough way. > > And also because most of the proposals are simply strong-typing in > disguise. If you turn scalars into objects and attach methods to those > objects are you still going to be able to call floor() on a numeric > string? This isn't as simple as people think on first glance and it > doesn't really clean up the global namespace since we still need to be > able to do type coercion which effectly implies that all scalar objects > need to include the bulk of the current set of scalar functions. > > -Rasmus > --e0cb4e43cff1ed6c2c04c507e24f--