Skip to content

Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback #7

@frankndungu

Description

@frankndungu

Hey guys if you are following this the tutorial you should know that PHP 8.1 does not accept

$router->get('/products', [ProductController::class, 'index']);

But it accepts;

$router->get('/products', [new ProductController(), 'index']);

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