Skip to content

Invalid error line in Fatal Error message #19081

Open
@HardlinePeak

Description

@HardlinePeak

Description

The following code:

<?php
class Test {
    public function __construct(
        public callable $example
    ) {}
}

Resulted in this output:

Fatal error: Property Test::$example cannot have type callable in /in/XWh84 on line 3

But I expected this output instead:

Fatal error: Property Test::$example cannot have type callable in /in/XWh84 on line 4

PHP Version

PHP 8.2.0 - 8.2.29, 8.3.0 - 8.3.23, 8.4.1 - 8.4.10

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