Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84567 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86338 invoked from network); 11 Mar 2015 18:28:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2015 18:28:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.180 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.217.180 mail-lb0-f180.google.com Received: from [209.85.217.180] ([209.85.217.180:46652] helo=mail-lb0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/8E-07702-43980055 for ; Wed, 11 Mar 2015 13:28:05 -0500 Received: by lbiz11 with SMTP id z11so10780447lbi.13 for ; Wed, 11 Mar 2015 11:28:01 -0700 (PDT) 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; bh=o0+zggLJJ9EixtVm6fUSJyKBlNZuGKXqCmS/UdNrao4=; b=Dvhn4WTSYnuypJfaiCxSWgMD1kw9uSdpR0m/v5A5txhoeyEXQceFTrbHp0+uR+umRB ypqCn32JawTbesClH6Ovc8daeaj7cTW6aKPEgdA1Fnx7JL4MCtYyWfyFvqjcO2fHRJG6 7WoKvBblzLD4FPmQOdWEppi1rP8YKR3iCwO0fZKhwfGfeS6FNUNd7RPAIjfC9LUPz8eZ P0iVigI4srJVZwNOfi4VljbBs4ufg4PUcMsXoyVjvkYfjm8neF4NHjk5dj6pPwlGwijm p2aj0TksGSBMz04hD6qEdq9z0XYYWyBo4uP8CXBliC72fhLF0Ma5BGrYQVCaRihlji+q lROw== MIME-Version: 1.0 X-Received: by 10.112.110.231 with SMTP id id7mr35922287lbb.28.1426098481483; Wed, 11 Mar 2015 11:28:01 -0700 (PDT) Received: by 10.25.43.9 with HTTP; Wed, 11 Mar 2015 11:28:01 -0700 (PDT) In-Reply-To: <76c47c6fbd961958c10bc1a069377a34@mail.gmail.com> References: <76c47c6fbd961958c10bc1a069377a34@mail.gmail.com> Date: Wed, 11 Mar 2015 14:28:01 -0400 Message-ID: To: Zeev Suraski Cc: Theodore Brown , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] RE: [VOTE][RFC] Coercive Scalar Type Hints From: ircmaxell@gmail.com (Anthony Ferrara) Zeev, >> You also stated above that false->bool is not supported (I'm guessing > you >> meant float->bool). So users would be able to pass "4.3" to a bool > typehint, >> but not 4.3? This behavior seems very arbitrary and confusing. > > It may be confusing, but only academically so. Again, this approach tries > to work well with real world usage - and reject conversions which are > likely to be erroneous. "4.3" may look like a floating point number but > in the context of conversion to boolean, that doesn't matter much. It's a > string. Doesn't that contradict what you've been saying the whole time about how "13" and 13 and 13.0 are really "the same thing", and as such should be coerced? > function bar(float $x) > $foo = 1; > bar($foo); // will definitely fail in strict mode No, actually it won't fail in strict mode: https://wiki.php.net/rfc/scalar_type_hints_v5#integers_should_be_accepted_for_strict_float_arguments Anthony