Skip to content

PHP 8.6 error_include_args=1 mishandled for include() #22849

Description

@TimWolla

Description

The following code:

<?php

ini_set('error_include_args', '1');

function foo() {
    include("does not exist");
}

foo(1, 2);

Resulted in this output:

Warning: include(1, 2): Failed to open stream: No such file or directory in /tmp/test3.php on line 6

Warning: include(1, 2): Failed opening 'does not exist' for inclusion (include_path='.:') in /tmp/test3.php on line 6

But I expected this output instead:

Warning: include("does not exist"): Failed to open stream: No such file or directory in /tmp/test3.php on line 6

Warning: include("does not exist"): Failed opening 'does not exist' for inclusion (include_path='.:') in /tmp/test3.php on line 6

PHP Version

git master

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions