ph-7/datatype

List of the available PHP data types, nicely stored into readable constant names

Maintainers

👁 ph-7

Package info

github.com/pH-7/PHP-type-names

pkg:composer/ph-7/datatype

Fund package maintenance!

Ko Fi

pH-7

Statistics

Installs: 5 165

Dependents: 2

Suggesters: 0

Stars: 7

Open Issues: 0

v1.0.2 2022-12-06 09:21 UTC

Requires

  • php: >=7.3.0

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT da629d3859f622213d30cbfbee3753785293bb21

constantstypesphp typestype names

This package is auto-updated.

Last update: 2026-06-06 16:29:36 UTC


README

Get all valid PHP type names with constants

📄 Overview

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.

⚙️ Requirements

⚙️ Installation

Install it easily with Composer

composer require ph-7/datatype

🤠 Example

require_once __DIR__ . '/vendor/autoload.php';

use PH7\Datatype\Type;

$id = settype($_GET['id'], Type::STRING);

$name = settype($inputName, Type::STRING);

😋 Who cooked it?

👁 Pierre-Henry Soria

Pierre-Henry Soria, a highly passionate, zen & pragmatic software engineer 😊

👁 @phenrysay
👁 pH-7

📺 The Video

👁 Watch the video

👉 Watch on YouTube 👈

⚖️ License

PHP type names is generously distributed under the MIT.