2017 © Pedro Peláez
 

library phptypehinting

Quick fix for type hinting with PHP

image

gabrieljmj/phptypehinting

Quick fix for type hinting with PHP

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

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' ...

The Versions

18/04 2015

dev-master

9999999-dev

Quick fix for type hinting with PHP

  Sources   Download

MIT

The Requires

  • php >=5.4

 

type hinting quick fix