library phptypehinting
Quick fix for type hinting with PHP
gabrieljmj/phptypehinting
Quick fix for type hinting with PHP
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
TypeHinting
Quick fix for type hinting with PHP., (*1)
Install
Composer:, (*2)
"gabrieljmj/phptypehinting": "dev-master"
Usage
use Gabrieljmj\PhpTypeHinting\TypeHinting;
TypeHinting::init();
function hello(string $name) {
echo 'Hello ' . $name;
}
hello('Gabriel');
will return, (*3)
Hello Gabriel
but, (*4)
hello(87);
will get, (*5)
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Argument 1 passed to hello() must be string type, integer given' ...
dev-master
9999999-dev
Quick fix for type hinting with PHP
Sources
Download
MIT
The Requires
type hinting
quick fix