php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80109 Cannot skip arguments when extended debug is enabled
Submitted: 2020-09-16 02:24 UTC Modified: 2020-09-16 04:23 UTC
From: dusk at woofle dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 8.0.0beta3 OS: any
Private report: No CVE-ID: None
 [2020-09-16 02:24 UTC] dusk at woofle dot net
Description:
------------
When running PHP with the -e ("Generate extended information for debugger/profiler") option, arguments with default values cannot be skipped using named arguments.

Test script:
---------------
<?php
function f($a = "hello", $b = "nobody") {
    print "$a $b\n";
}

f(b: "world");

Expected result:
----------------
The script should behave identically (printing "hello world") when running with and without "-e".

Actual result:
--------------
Fatal error: Uncaught ArgumentCountError: f(): Argument #1 ($a) not passed

when running with -e.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-16 04:23 UTC] dusk at woofle dot net
FWIW: This bug is caught when running the Zend/tests/named_params/ test suite with "-e".
 [2020-09-17 08:03 UTC] [email protected]
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Apr 28 15:01:23 2021 UTC