Bug #80334 [Opn->Ver]: assert() vs named parameters - confusing error

From: Date: Mon, 09 Nov 2020 09:02:49 +0000
Subject: Bug #80334 [Opn->Ver]: assert() vs named parameters - confusing error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230214@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80334&edit=1 ID: 80334 Updated by: nikic@php.net Reported by: bugs dot php dot net_nospam at adviesenzo dot nl Summary: assert() vs named parameters - confusing error -Status: Open +Status: Verified Type: Bug Package: *General Issues Operating System: N/A PHP Version: 8.0.0RC3 Block user comment: N Private report: N New Comment: The problem is that we're appending the generated message to the arguments, which doesn't work for named args. Previous Comments: ------------------------------------------------------------------------ [2020-11-07 22:30:45] bugs dot php dot net_nospam at adviesenzo dot nl Description: ------------ The "Cannot use positional argument after named argument" exception is sometimes thrown in situations where named parameters isn't supported. Test script: --------------- <?php $null = null; // https://3v4l.org/qgfV2 assert(assertion: is_null($null)); // https://3v4l.org/q8Oqq $a = is_null($null); assert(assertion: $a); Expected result: ---------------- Either named parameters being supported (= no error). Or named parameters not being supported and the code resulting in a parse error. NOT an error referring to named arguments, while the language construct doesn't seem to support it. Actual result: -------------- Fatal error: Cannot use positional argument after named argument in /in/qgfV2 on line 3 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80334&edit=1

« previous php.bugs (#230214) next »