Home > Article > PHP Framework > Laravel 10 is coming with new features?
According to the Support Policy document, Laravel 10 will be released on February 7, 2023.
This is a tall order considering the size of the Laravel ecosystem, and Laravel prioritizes backwards compatibility. [Recommended: laravel video tutorial]
Laravel 10 will use native PHP type declarations in any generated code that exists in user space:
Adding types brings the latest PHP type hinting capabilities to Laravel projects without breaking backward compatibility at the framework level:
Return types
Method arguments
Remove redundant comments where possible
/** * Get the host patterns that should be trusted. * * @return array<int, string> */ public function hosts(): array { return [ 'laravel.test', ]; }In the above example, the IDE will know the shape of the array, which is information that is not possible in PHP's native type design. In addition, all code generated by the framework will follow the same type hinting guidelines mentioned above, which means that when you create files using the "make" command, they will include native type hints in the same way as above.
The above is the detailed content of Laravel 10 is coming with new features?. For more information, please follow other related articles on the PHP Chinese website!