0
I’m starting to use language heavily typed in PHP 7.
declare(strict_types=1);
But I couldn’t find a way to debug the bug and show where it is.
I searched hard but couldn’t find.
What should I wear?
I’ve tried to:
ini_set("display_errors",true);
ini_set("display_startup_erros",true);
error_reporting( E_ALL | E_STRICT | E_NOTICE );
And I can’t display the mistakes of declare(strict_types=1);
The idea is, if I do:
public function verNumero (int $num) : int {
return $num++;
}
and call the method so:
echo verNumero('7')
instead of
echo verNumero(7)
This will bring me a mistake that without:
ini_set("display_errors",true);
ini_set("display_startup_erros",true);
error_reporting( E_ALL | E_STRICT | E_NOTICE );
it would not be possible to know where it is. On the contrary, the page would not even open.
What I want is to know what kind of error display controller to put in the code so I can see where the bug is instead of a blank page when using:
declare(strict_types=1);
PHP has never been and will never be heavily typed, at most it can now have type checking and approach static typing. To be strongly typed it would have to change its semantics and break several existing codes. https://answall.com/q/21508/101 Otherwise I don’t know what you want, what’s going wrong the question doesn’t make clear what the real problem is.
– Maniero
added more details to the question
– Carlos Rocha