Why isn't Laravel core still type-hinted?

Posted 4 months ago by RoboRobok

Newest Laravel requires PHP 7.1.3. Primitive type hinting is there for a while, but Laravel core still doesn't use it. Even Symfony has its core type-hinted now.

I create this topic to understand if there is any potential benefit of avoiding type hints. In my opinion, the lack of them lead to bugs that are difficult to track. Laravel core uses type hinting only for arrays and sometimes Closures. Several times, I have seen code that was buggy, because the type wasn't checked prior to using the variable. So a method pooped in the middle instead of at the beginning.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.