-
Notifications
You must be signed in to change notification settings - Fork 184
call_user_func() expects non-static method #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You should not set I think you don't have latest version of the code. |
Still curious on why it claims it has to be static method inside call_user_func(). I'll keep trying. So far, I have followed the tutorial by baby steps, and there it is working without the error. |
Now I see the problem. @thecodeholic himself correct it around 1:11:15 of the freeCodeCamp.org youtube video. |
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.
Isn't it better to instatiate SiteController, then call for it?
As follows:
$siteController = new SiteController();
$app->router->get('/contact', [$siteController, 'contact']);
The text was updated successfully, but these errors were encountered: