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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 - 21 = ?
Subscribe to this entry?

 
 [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: Sat Apr 20 08:01:30 2024 UTC