Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67894 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70796 invoked from network); 26 Jun 2013 16:25:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 16:25:36 -0000 Authentication-Results: pb1.pair.com header.from=florinpatan@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=florinpatan@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.174 as permitted sender) X-PHP-List-Original-Sender: florinpatan@gmail.com X-Host-Fingerprint: 209.85.214.174 mail-ob0-f174.google.com Received: from [209.85.214.174] ([209.85.214.174:32908] helo=mail-ob0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/E8-29746-FF51BC15 for ; Wed, 26 Jun 2013 12:25:35 -0400 Received: by mail-ob0-f174.google.com with SMTP id wd20so13614386obb.5 for ; Wed, 26 Jun 2013 09:25:33 -0700 (PDT) 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=5GtUVrmSWQzy6LhSmbQ8vk6k1a3rK5Xgc6RSbJlFfS4=; b=osRqCjHYmfz6E0OBINgsBiVaFthxB2OcRThbraGY+3o09pluo7jBeJ0vjPWV/cqicb zN8nAczJpNOpXxAWGrklwLhzIFb+isJ/mNlDRZ1vH2RzgqQ+pspy7QWjKmKXzngTZ1lt P3YfsUcvZA07LJVoz1h0i0PSUD4Ku0IZDgZ++gPatNywSyDyAwpFgaiSBSfX54gkDyMI whBYopC7xpAuEp4PYvvL6U5NyYZ8kZF7jxfXq1497nZuCB+Gvjldo9lJdSwHMSXoAxDw 1AFoCF4dQGktYp+7FP39NXguDsPwFn4fLrr98G1EZn7Ka8QPiSHW+vz2jdk+PINEdncE Nofg== X-Received: by 10.182.242.45 with SMTP id wn13mr2100620obc.30.1372263933066; Wed, 26 Jun 2013 09:25:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.18.161 with HTTP; Wed, 26 Jun 2013 09:25:03 -0700 (PDT) In-Reply-To: <51CB10A4.70809@sugarcrm.com> References: <51CB10A4.70809@sugarcrm.com> Date: Wed, 26 Jun 2013 18:25:03 +0200 Message-ID: To: Stas Malyshev Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Request for comments - new PHP feature: return typing From: florinpatan@gmail.com (Florin Patan) On Wed, Jun 26, 2013 at 6:02 PM, Stas Malyshev wrote: > Hi! > >> Currently PHP doesn't support what could be a good feature for code >> quality, return typing (or if you prefer to call it: return type >> hinting). > > What changed since the last time we discussed this? > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 Hi, Well I don't want to sound disrespectful, but to be honest, nothing really. Just the year and the fact that I don't want to allow for double return types, like object or null or false, like in the other proposal, if you would read the gist. While I would like to have full type hinting available, including scalars as well, I think we could greatly benefit from it even without them. Like I've said, it's about code quality, something that PHP programmers lack today badly because PHP is so flexible (don't even try to argue with that). As for the argument of don't design features that are optional, like you've said in the past discussion, here's a optional feature that everyone uses it today: argument type hinting. Is it optional, yes? Could we live without it? Yes. Would everyone be sane without it? Not sure. PHP is too flexible for its own good. The fact that we have good use cases for such a feature, just look at the thread so far, makes is useful to consider. And I don't understand why having return typing would be such a bad thing when we already have argument typing, which is a half baked feature (even worst, no?) as it doesn't allow for scalar hinting. And just having this half baked feature in the language makes is very unattractive for some people and reduces the code quality, but for others it's extremely useful, do you want to argue that we don't need this because .... ? Best regards ---- Florin Patan https://github.com/dlsniper http://www.linkedin.com/in/florinpatan