Get all valid PHP type names with constants β
Simple library containing the list of constants for the available PHP data types. Use those constant types in your project when you need to mention a data type, use those constants instead of hardcoding them.
- PHP 7.3 or newer.
Install it easily with Composer
composer require ph-7/datatype
require_once __DIR__ . '/vendor/autoload.php';
use PH7\Datatype\Type;
$id = settype($_GET['id'], Type::STRING);
$name = settype($inputName, Type::STRING);
Pierre-Henry Soria, a highly passionate, zen & pragmatic software engineer π
π Watch on YouTube π
PHP type names is generously distributed under the MIT.