Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58820 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95677 invoked from network); 9 Mar 2012 13:54:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2012 13:54:32 -0000 Authentication-Results: pb1.pair.com header.from=linepogl@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=linepogl@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:38900] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/3E-10820-69B0A5F4 for ; Fri, 09 Mar 2012 08:54:31 -0500 Received: by yenl5 with SMTP id l5so956360yen.29 for ; Fri, 09 Mar 2012 05:54:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=jlAQ0v5C2DM5HK5JUowX2kq0lAH+/7yHzShHV1z8Xkc=; b=xxsPkzc8mJGgCq91pPPSxNj7HTiI11GpgfOXaRmyZGYuq+3hbX6cUJSHHqWrhZY+Ql Gby/vw1xLhtjMfmZJ+ZyjcEVKyI5w8FVnUNXqKCkzpMmlAAdP48eZ6H6hrkrPmcMpg1U /My9oyZ5jIZdCEGZz5VMFjyt54+CFcCUkzrdA4MHoqOL6DdHPcJ5KDo/RapXW7cOOc3R Z1UF0HJDWn4BR/XBZuSZWbc0pPLkw1acb4oCm4wEh+oWw5rWQO6hZtwJta8L/JazYDAn q6H1NrWxc10Qyz5YR+FmcYT9ivxJNNPGJwtcAyL5Sdj3YZ97qDokmqzH7zxDXvyR3wH9 TvBQ== Received: by 10.101.128.12 with SMTP id f12mr718690ann.49.1331301268425; Fri, 09 Mar 2012 05:54:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.146.144.35 with HTTP; Fri, 9 Mar 2012 05:54:08 -0800 (PST) In-Reply-To: References: Date: Fri, 9 Mar 2012 14:54:08 +0100 Message-ID: To: Anthony Ferrara Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=0016e68dbb74318df904bacfbbf6 Subject: Re: [PHP-DEV] [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters From: linepogl@gmail.com (Lazare Inepologlou) --0016e68dbb74318df904bacfbbf6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yes, like that, only better. Since automatic type casting is central in PHP, as this is evident after all this discussion, I believe that it should be better supported. There are two thinks that I would like to see here: 1. No more magic methods, please. 2. It should cover (eventually) casting to and from any type. :-) Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel 2012/3/9 Anthony Ferrara > > (Now, it would be nice to have another RFC about custom object casting = to > > int, float and bool...) > > You mean like https://wiki.php.net/rfc/object_cast_to_types which is > still in draft? > > Note that __toBool would be problematic, since it would be called if > the object was used in an if statement, which could yield some very > strange results if it returned false (it would break the existing > semantics about how we can use if statements to determine if the type > is populated)... > > Anthony > --0016e68dbb74318df904bacfbbf6--