|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80334 assert() vs named parameters - confusing error
Submitted: 2020-11-07 22:30 UTC Modified: 2020-11-09 09:02 UTC
From: bugs dot php dot net_nospam at adviesenzo dot nl Assigned:
Status: Closed Package: *General Issues
PHP Version: 8.0.0RC3 OS: N/A
Private report: No CVE-ID: None
 [2020-11-07 22:30 UTC] bugs dot php dot net_nospam at adviesenzo dot nl
The "Cannot use positional argument after named argument" exception is sometimes thrown in situations where named parameters isn't supported.

Test script:
$null = null;

assert(assertion: is_null($null));

$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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-09 09:02 UTC]
-Status: Open +Status: Verified
 [2020-11-09 09:02 UTC]
The problem is that we're appending the generated message to the arguments, which doesn't work for named args.
 [2020-11-09 09:19 UTC]
Automatic comment on behalf of
Log: Fixed bug #80334
 [2020-11-09 09:19 UTC]
-Status: Verified +Status: Closed
 [2020-11-09 13:47 UTC] bugs dot php dot net_nospam at adviesenzo dot nl
Thanks @nikic!
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Oct 01 15:01:25 2023 UTC