Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76007 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89499 invoked from network); 24 Jul 2014 12:20:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2014 12:20:17 -0000 Authentication-Results: pb1.pair.com header.from=simonsimcity@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=simonsimcity@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.45 as permitted sender) X-PHP-List-Original-Sender: simonsimcity@gmail.com X-Host-Fingerprint: 74.125.82.45 mail-wg0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:46749] helo=mail-wg0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/55-58899-00AF0D35 for ; Thu, 24 Jul 2014 08:20:17 -0400 Received: by mail-wg0-f45.google.com with SMTP id x12so2614801wgg.28 for ; Thu, 24 Jul 2014 05:20:17 -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=S2Y/6I9qZDcE+1DqjbCqcM4qQNNXbTy9jniBhl+QJ0M=; b=fICdW2gjdlDcD9DWSW2Ar/Ro7EvO4+Jm33PRw9Zg03REXh6E9nJvPtyRqB0JN/A/ml VX2fU5Hhj3AfEzMnHMAshbC1wF791jeSwJvlxsIS3fnrEiMtZwWE2qNNZIDgbII7VHAk EmJetSHOzPLyPch4SnHHj+NhapUGQaMTb5K39WOBm9EXylArGLto/8JWkw91FYrUnNL3 Cl0ClckkpnwbEwaz7rI8PtuRxl2C0v/ECOEP/XgtjcHOhPmCmTFuplUOFMA2/2sJCv7H 71YLwIj8cuW1Eqw9cvcxAQgkoFZZtFKgqXc01nyU2qakqq2qIiZvFikqOCq+UGirnrfi SkMg== MIME-Version: 1.0 X-Received: by 10.194.90.79 with SMTP id bu15mr11646200wjb.17.1406204416779; Thu, 24 Jul 2014 05:20:16 -0700 (PDT) Received: by 10.194.222.134 with HTTP; Thu, 24 Jul 2014 05:20:16 -0700 (PDT) In-Reply-To: <33bf22776118d2b4ddafee7014a826b2@mail.gmail.com> References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <12448510.rPWIJSKt4t@rofl> <53D0CBE2.5010200@sugarcrm.com> <33bf22776118d2b4ddafee7014a826b2@mail.gmail.com> Date: Thu, 24 Jul 2014 14:20:16 +0200 Message-ID: To: Zeev Suraski Cc: Stas Malyshev , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: simonsimcity@gmail.com (Simon Schick) > My main concern about the RFC the way it stands right now is that the > current direction involves E_RECOVERABLE_ERROR instead of E_STRICT or E_CAST > for data loss. This results in both consistency issues with casting as well > as incompatibility with the dynamic nature of PHP scalars. I know the RFC > author (Andrea) disagrees with me about it, but I think we need to find a > way to put this into a much wider decision. Probably the most practical > thing to do is to put it as a secondary question in the RFC, although those > can be tricky. > > Zeev Hi, all I looked again at the RFC .. Can someone please update the description at the section "Conversion Rules"? This is quoted from the document: > Conversion is allowed only if data-loss does not happen. There are a few exceptions (objects using __toString, strings containing leading numerics, etc). Here's a table of examples. But if you look at the table, strings containing leading numbers are not allowed. And just as a thought: What about objects where the __toString method returns a string like "42"? Would that also be accepted as an argument, that just accepts integers? Sounds crazy, but as strings, only containing numbers, are accepted as integer, we have to take a decision here and write it down. Bye Simon