Bug #80334 [NEW]: assert() vs named parameters - confusing error

From: Date: Sat, 07 Nov 2020 22:30:45 +0000
Subject: Bug #80334 [NEW]: assert() vs named parameters - confusing error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230177@lists.php.net to get a copy of this message
From:             bugs dot php dot net_nospam at adviesenzo dot nl
Operating system: N/A
PHP version:      8.0.0RC3
Package:          *General Issues
Bug Type:         Bug
Bug description:assert() vs named parameters - confusing error

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 bug report at https://bugs.php.net/bug.php?id=80334&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80334&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80334&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80334&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80334&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80334&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80334&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80334&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80334&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80334&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80334&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80334&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80334&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80334&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80334&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80334&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80334&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80334&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#230177) next »