Skip to content

call_user_func() expects non-static method #2

@marquesine

Description

@marquesine

Why is that? Is it part of the last PHP 7.4 updates?

Setting public static funcion won't cause any future problems?

Also, it is curious that the error is pointed, but the return of the function still appears below it.

Screenshot_2021-02-23 Screenshot

Isn't it better to instatiate SiteController, then call for it?

As follows:

$siteController = new SiteController();
$app->router->get('/contact', [$siteController, 'contact']);

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