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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dusk at woofle dot net
New email:
PHP Version: OS:

 

 [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] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e3d0bc0a981f11970415ab3ac635b98f6740bfb4
Log: Fixed bug #80109
 [2020-09-17 08:03 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC