Skip to content

PHP 8.0: Calling non-static class methods statically result in a fatal error #7

@ERP-Academia

Description

@ERP-Academia

Php8 does not accept
$app->router->post('/contact', [SiteController::class, 'handleContact']);

It accepts
$app->router->post('/contact', [new SiteController(), 'handleContact']);

The problem occurs if you are building the framework following the steps in the video. It is solved later in Router->resolve()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions