Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82996 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23048 invoked from network); 17 Feb 2015 18:33:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 18:33:07 -0000 Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:27301] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/6A-19463-26983E45 for ; Tue, 17 Feb 2015 13:33:06 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id ADE7F4B021B; Tue, 17 Feb 2015 19:32:45 +0100 (CET) Reply-To: To: "'Lester Caine'" , References: <011801d04a07$83ab1c00$8b015400$@php.net> <016f01d04a3a$e9183220$bb489660$@php.net> <022801d04ab1$4a0c47d0$de24d770$@php.net> <1913e09d7f52541901d8574d2080a63f@mail.gmail.com> <54E35855.4060906@lsces.co.uk> <025a01d04ac6$b3cd7170$1b685450$@php.net> <54E364AE.8090907@lsces.co.uk> In-Reply-To: <54E364AE.8090907@lsces.co.uk> Date: Tue, 17 Feb 2015 19:33:00 +0100 Message-ID: <027401d04ae0$28b64cf0$7a22e6d0$@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGD0sLDaA+/0NIeBlQhQC5OtPA/xwHih9+6AanvcsEBj7eMCwEU0CpMAs0H7+gBDwGZjwJNu28fAWzN038BTcdE4wK3JE5jAZIhIymc8x8zYA== Content-Language: fr X-Antivirus: avast! (VPS 150217-1, 17/02/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] Reviving scalar type hints From: francois@php.net (=?utf-8?Q?Fran=C3=A7ois_Laupretre?=) > De : Lester Caine [mailto:lester@lsces.co.uk] > > My current practice up until now has been to use 'return false' when = an > action failed, but the main return would be a number of records or > string of data. So you are now blocking that activity ... I'm reading = to > right, but you are not thinking all possibilities through. But I think > I'm starting to see it broken already with the other changes to the = core > :( I'm not returning 'IS_FALSE' so I'm probably going to have to = change > the 'false' to '0' anyway so as to avoid the bool? Hi Lester, I am not blocking anything. My objective is to provide union types. = Using union types, you will declare your return type as 'int|bool'. = That's why I was pushing to integrate this feature in the first release. = It will be done if we have enough time, but it is a lot to integrate in = a discussion that must be quite short, as time is restricted. I am surely not thinking all possibilities :) but returning integer or = false is usual and in scope. The solution is not to authorize (bool -> = int) conversion (as it would have to support (bool -> anything)), but = support 'int|bool', 'resource|bool', and similar syntax. So, the = solution is completely different from the (int -> bool) question. Even, if we don't release union types in 7.0, it will be clearly stated = that it is a required follow-up. That's not perfect but we do it as fast = as we can and everyone is welcome to help. What does this mean in your case ? Just that, as long as the feature is = not available, your function won't have an explicit return type. Period. = And, please, don't change false to 0 ;). Regards Fran=C3=A7ois