PHP Strict typing
Since PHP 7.0, some of the harmful effects of type juggling can be mitigated with strict typing. By including this declare statement as the first line of the file, PHP will enforce parameter type declarations and return type declarations by throwing a TypeError exception.
For example, this code, using parameter type definitions, will throw a catchable exception of type TypeError when run:
Likewise, this code uses a return type declaration; it will also throw an exception if it tries to return anything other than an integer: