Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84673 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85206 invoked from network); 13 Mar 2015 09:57:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2015 09:57:13 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.53 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.218.53 mail-oi0-f53.google.com Received: from [209.85.218.53] ([209.85.218.53:35070] helo=mail-oi0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/9E-24603-874B2055 for ; Fri, 13 Mar 2015 04:57:13 -0500 Received: by oigh136 with SMTP id h136so7223559oig.2 for ; Fri, 13 Mar 2015 02:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=g3Q1ZYjDuqlkwQq9V4FNNPywchhefmrpM1t0hYTCzPo=; b=cDT6qfQr1wR4z1WD6IH/j/+lnXv3bY+gd1QX1TOSTy3D0ZIHLbrisREAwgABAmghOq rHulDqWU0TB1BsnVfeCJP6PgzUuQ1eHn9r5YbCamg3kASs+7Hp092QwpPxE6t6GLodL6 dz8QAoRrMlVsfIFz6TiBvZTX1WrWokygLjXh2+oiJAoNwqY7TezApm+uBXJAkXbQngy3 z/F7iGeT/U4jPTtHAJjF66AVNVx9MHKnPNAQTBc2NZ5uJPico5l4+dJTSp8o3B5xdWA5 fgs2B+/+QYmtVmls5j7foIFEsxR7uEg6zRtj0T6b2PtQi+Q9HXxLkcG23jMGQK2lv+J7 xKUg== X-Received: by 10.182.128.234 with SMTP id nr10mr37129113obb.62.1426240629642; Fri, 13 Mar 2015 02:57:09 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.202.58.2 with HTTP; Fri, 13 Mar 2015 02:56:28 -0700 (PDT) In-Reply-To: References: Date: Fri, 13 Mar 2015 18:56:28 +0900 X-Google-Sender-Auth: dyg_Gew0hkL2cipme6MtEfuctI0 Message-ID: To: Zeev Suraski Cc: PHP internals Content-Type: multipart/alternative; boundary=089e015382b6187dfb05112886c2 Subject: Re: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e015382b6187dfb05112886c2 Content-Type: text/plain; charset=UTF-8 Hi Zeev, On Thu, Mar 12, 2015 at 12:10 AM, Zeev Suraski wrote: > The latest version of the RFC includes changes discussed on internals@ > last > week: > > 1. Accept string->bool and int->bool conversions (false->bool is not > supported) > > 2. Accept leading/trailing spaces in string->number conversions. > > > > wiki.php.net/rfc/coercive_sth > > wiki.php.net/rfc/coercive_sth#vote > Status should be changed to "voting". It's "under discussion" now. It's not nice to have 2 modes for new feature while we can do it in a single mode. BC matters, but cleaner and simpler design would bring more benefits for both PHP users and developers. There is enough time to adopt for users. The default behavior is better with this RFC. Weak mode defined in other RFC is too weak to be useful while strict mode seems too restrictive. e.g. 100) trigger_error('Invalid range'); } // Somewhere far from function definition. $num = $GET['num']; // Somewhere far from $num definition. check_num_range($num); // Trying to check validity, int and range. echo 'You have '.$num. ' now
'; // But $num could have any string. // "check_num_range((int)$num)" wouldn't help also. ?> If we decide to have even more stricter hint in the future, we may decide to use "strict" mode with this RFC. This is more preferable path for PHP being type aware. IMHO. For these reasons, I voted "yes" for this, "no" for the other. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e015382b6187dfb05112886c2--