Top "Php-8" questions

For questions specific to the usage and features of PHP 8. When using this tag also include the more generic [php] tag.

Laravel app stopped working after upgrading to php 8

after updating my mac to php 8 laravel app stopped working, this is the error I'm getting: Deprecated: Method ReflectionParameter::getClass() …

php laravel php-8
Required parameter $xxx follows optional parameter $yyy

Deprecated: Required parameter $xxx follows optional parameter $yyy in... Since upgrading to PHP 8.0 this error is thrown when running code …

php function-signature php-8
Is there a way to catch an Exception without having to create a variable?

In PHP, I sometimes catch some exceptions with try/catch : try { ... } catch (Exception $e) { // Nothing, this is normal } With that …

php exception error-handling try-catch php-8
Is it possible to type hint more than one type?

Can I allow two different types using type hinting? E.g. parameter $requester could be either of User or File: …

php type-hinting php-8
How to install PHP 8 on XAMPP

I'm trying to update my PHP version to the brand new PHP 8. I have followed simular steps as this tutorial. …

php apache xampp php-8
Does PHP have "named parameters" so that early arguments can be omitted and later arguments can be written?

In PHP you can call a function with no arguments passed in so long as the arguments have default values …

php named-parameters default-arguments php-8
Declaration of OM\Db::query(string $statement) must be compatible with PDO::query

I just installed PHP 8 and I have this error appears? How do I fix it? Fatal error: Declaration of OM\…

php php-8
Is it possible to use named function parameters in PHP?

Is it possible in php like in python to have named function parameters? An example use case is: function foo($…

php named-parameters php-8
Laravel in PHP 8 dev

I have a docker container with php 8.0.0-dev and composer. I want to create a Laravel application to test the …

php laravel composer-php php-8
How can i use php8 attributes instead of annotations in doctrine?

This is what I would like to use: #[ORM\Column(type: "string")] instead of this: /** * @ORM\Column(type="string") */ But …

php symfony doctrine-orm doctrine php-8