Bug->Doc #71363 [Opn]: No documentation on E_NOTICE for trailing characters with weak int/float hints

From: Date: Wed, 13 Jan 2016 23:58:46 +0000
Subject: Bug->Doc #71363 [Opn]: No documentation on E_NOTICE for trailing characters with weak int/float hints
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13098@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71363&edit=1 ID: 71363 Updated by: requinix@php.net Reported by: benjamin dot morel at gmail dot com -Summary: Inconsistent handling of malformed integers +Summary: No documentation on E_NOTICE for trailing characters with weak int/float hints Status: Open -Type: Bug +Type: Documentation Problem Package: Scripting Engine problem Operating System: Fedora 23 PHP Version: 7.0.2 Block user comment: N Private report: N New Comment: See https://wiki.php.net/rfc/scalar_type_hints#behaviour_of_weak_type_checks I don't see any mention of the potential for notices on the function arguments page... http://php.net/manual/en/functions.arguments.php Previous Comments: ------------------------------------------------------------------------ [2016-01-13 23:44:21] benjamin dot morel at gmail dot com Description: ------------ When using scalar type hinting, some malformed integers report a TypeError, while others raise a E_NOTICE. Test script: --------------- function test(int $a) {} test(null); // TypeError test("x"); // TypeError test("x1"); // TypeError test("1x"); // E_NOTICE Expected result: ---------------- test("1x"); // TypeError Actual result: -------------- test("1x"); // E_NOTICE ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71363&edit=1

« previous php.doc.bugs (#13098) next »