Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86215 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45064 invoked from network); 14 May 2015 09:47:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 May 2015 09:47:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.53 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.53 mail-qg0-f53.google.com Received: from [209.85.192.53] ([209.85.192.53:33866] helo=mail-qg0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/F5-31470-F2F64555 for ; Thu, 14 May 2015 05:47:28 -0400 Received: by qgfi89 with SMTP id i89so34652063qgf.1 for ; Thu, 14 May 2015 02:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=8HK3dCYMCVRzBgDOhOmqeie7srIKLFt6Z7nICVonG5g=; b=vbb2T7kxLhpHDzpfAKUEIOXQqtdczcYbHh+fWMXctGokTrlHTsF8zfhPDMgbfnPfB2 SjP0xVsxDQH09rmh7rY/6WnkaWh60Mw9KCeMI7ok61esxjw2XUR+AuM0n8C6IChUeOmQ +4cBmyePM1ky2EFiD95Aczu/2eVuQrMaZP8j6ymSMA/+XveSb2pDqH/0PoncqNu2J2AE LEZMnBp3Vrp2pDpG7mF62Mjdm8ab2k457LoUmczQI9ZYUMUwyQ69aAZKvJQyJEHRsrUn i9ffcttq0dITCrNYvFw8Cfu0ea3BIIqDRzG1r0yRmM8yr+1FzPKsRz5UjSjGN12t+uKS LKIg== X-Received: by 10.55.51.1 with SMTP id z1mr4337892qkz.81.1431596845250; Thu, 14 May 2015 02:47:25 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.202.104.196 with HTTP; Thu, 14 May 2015 02:46:40 -0700 (PDT) Date: Thu, 14 May 2015 18:46:40 +0900 X-Google-Sender-Auth: -W7SdenNTqxri8iuihseVEoasa4 Message-ID: To: Anthony Ferrara , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11470a866c405e0516079d69 Subject: PHP7 scalar type hint error bug? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11470a866c405e0516079d69 Content-Type: text/plain; charset=UTF-8 Hi Anthony, I'm experimenting type hints to write how it could be useful. http://3v4l.org/nhI61 I thought too large value error in weak mode is E_RECOVERABLE_ERROR, but it's not. The RFC ( https://wiki.php.net/rfc/scalar_type_hints_v5 ) does not state how it behaves for too large values. E_ERROR is too severe for too large values. Behavior like this http://3v4l.org/avsW4 is preferred because it's much easier to handle errors nicely. E_ERROR is too severe even for strict_types=1, IMHO, because user does not have chance to handle errors nicely at all. http://3v4l.org/aEpP8 Is this behavior is agreed behavior by discussion or a bug? In the RFC https://wiki.php.net/rfc/scalar_type_hints_v5#behaviour_of_strict_type_checks it says --------------------- Behaviour of strict type checks A strictly type-checked call to an extension or built-in PHP function changes the behaviour of zend_parse_parameters. In particular, it will produceE_RECOVERABLE_ERROR rather than E_WARNING on failure, and it follows strict type checking rules for scalar typed parameters, rather than the traditional weak type checking rules. --------------------- It seems intended error level is E_WARNING/E_RECOVERABLE_ERROR according to the RFC. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11470a866c405e0516079d69--