Skip to content

Casting class to string should raise error #6

@muglug

Description

@muglug

Should be errors:

class A {}
echo (new A);
class A {
    function __toString() : void { }
}
echo (new A);
class A {
    function __toString() { }
}
echo (new A);

should not be an error:

class A {
    function __toString() : string {
        return 'hello';
    }
}
echo (new A);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions