Skip to content

declare(strict_types=1) does not ignore null AST nodes #19719

@FearXenon

Description

@FearXenon

Description

The following code:

<?php
// e.g some comments
?>
<?php
declare(strict_types=1);
?>

Resulted in this output:

Fatal error: strict_types declaration must be the very first statement in the script in /home/tmp/test.php on line 5
Stack trace:
#0 {main}

But I expected this output instead:

PHP Version

nightly

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