Skip to content
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

Callback issue #31

Closed
Orio-nn opened this issue Aug 13, 2022 · 1 comment
Closed

Callback issue #31

Orio-nn opened this issue Aug 13, 2022 · 1 comment

Comments

@Orio-nn
Copy link

Orio-nn commented Aug 13, 2022

When creating a function callback with the link below it throws an error

get('/', function() {
	echo "test";
});

However, if you change the link to literally anything else, it will work. This issue seems to only be present on / link.
The error message created is attached below.

Fatal error: Uncaught Error: Object of class Closure could not be converted to string in C:\xampp\htdocs\rbc\router.php:38 Stack trace: #0 C:\xampp\htdocs\rbc\router.php(6): route('/', Object(Closure)) #1 C:\xampp\htdocs\rbc\routes.php(14): get('/', Object(Closure)) #2 {main} thrown in C:\xampp\htdocs\rbc\router.php on line 38

This issue was tested with a brand new clone of this repo.

@phprouter
Copy link
Owner

Callbacks are not intended to be used on the "/" route

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants