Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80113 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31258 invoked from network); 3 Jan 2015 04:50:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2015 04:50:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.177 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.177 mail-qc0-f177.google.com Received: from [209.85.216.177] ([209.85.216.177:53985] helo=mail-qc0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/10-29610-10577A45 for ; Fri, 02 Jan 2015 23:50:10 -0500 Received: by mail-qc0-f177.google.com with SMTP id x3so13635872qcv.36 for ; Fri, 02 Jan 2015 20:50:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=lPQJy5St9P37nHYsSqxz5aeyYnDFLU1X40PN6GKWI7s=; b=DTlYtAThDiVnsQupoH6pXDKV4pK3YzZnDyGrfiJCjOwMTetVROfllbSdQqdFRtgJg8 zuKZQzIOFultzCnRqtbgunGBzxQM01nAw8UQ9Qroyn7dkRYU3W6hFE4qcSqor23uWV7J zn7b9QTtNtdKGRDCx3ny5/69fQpsZVWvHyf7q+aZv9JMSg4/qHvR3Y6FuKAOz84C2Hxk UjWINk02r8cITt56BhVqCO6owYtnbXBDSu+d2zUKYQi5zJBXZIT7QeSjP7UQODzR9zJv hnHVyPZFUwm86TNQIhxPE9KUztXH8XN9ecydjxOrppG2GHU66J+/AgjiN49tzzl3JPO6 bijA== MIME-Version: 1.0 X-Received: by 10.224.15.78 with SMTP id j14mr131369729qaa.0.1420260606351; Fri, 02 Jan 2015 20:50:06 -0800 (PST) Received: by 10.140.22.106 with HTTP; Fri, 2 Jan 2015 20:50:06 -0800 (PST) In-Reply-To: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> Date: Fri, 2 Jan 2015 20:50:06 -0800 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: pierre.php@gmail.com (Pierre Joye) hi Andrea, On Wed, Dec 31, 2014 at 12:27 PM, Andrea Faulds wrote: > Good evening, > > Parameter type hints for PHP=E2=80=99s scalar types are a long-requested = feature for PHP. Today I am proposing an RFC which is a new attempt to add = them to the language. It is my hope that we can finally get this done for P= HP 7. > > I=E2=80=99d like to thank Dmitry, who emailed me and gave me some feedbac= k on the draft RFC and some improvements to the patch. He encouraged me to = put this to internals sooner rather than later, as it=E2=80=99s a feature m= any people are hoping will be in PHP 7. > > The new RFC can be found here: https://wiki.php.net/rfc/scalar_type_hints > > As well as the RFC, there is a working Zend Engine III patch with tests, = and an incomplete specification patch. > > Please read the RFC (and specification patch, if you wish) and tell me yo= ur thoughts. Thanks, great work and persistent effort! As I am also slightly in favor of a strict way, this RFC is a good compromi= se. Some comments: - on-numeric strings not accepted. Numeric strings with trailing characters are accepted, but produce a notice. I would rather not allow fancy conversions here. Any trailing non white spaces characters should not be allowed. I know it is not what PHP does now in some cases but this is really a fuzzy area and never really matched any actual needs or usages. I am also not a fan of errors, exception, at least for methods, make much more sense. I know it is relatively easy to handle errors as exception but still, let do it right now. Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org