Quantcast
Channel: Do strict types in PHP affect variables? - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Jay Blanchard for Do strict types in PHP affect variables?

It is because you are strict typing only the input of the function, not the return or any of the variables in the function itself. From the docs -Strict typing applies to function calls made from...

View Article



Do strict types in PHP affect variables?

I know when using declare(strict_types=1) I must pass parameters of given type otherwise an Exception is raised, but one question:declare(strict_types=1);function add(int $firstNumber, int...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images