PHPackages                             ahmedzidan/php-value - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ahmedzidan/php-value

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ahmedzidan/php-value
====================

A modern replacement for PHP’s gettype function.

1.0.1(4y ago)0111UnlicensePHPPHP ^5.6 || ^7.0 || ^8.0

Since Feb 22Pushed 4y agoCompare

[ Source](https://github.com/AFZidan/php-value)[ Packagist](https://packagist.org/packages/ahmedzidan/php-value)[ RSS](/packages/ahmedzidan-php-value/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/4cef7ccde6818fd1fd2ac3a915c8024ebbdda6ee44cb8b15e8955d1942363a1a/68747470733a2f2f706f7365722e707567782e6f72672f666c6573686772696e6465722f76616c75652f762f737461626c65)](https://packagist.org/packages/fleshgrinder/value)[![License](https://camo.githubusercontent.com/10e4b17fe3462e843dbf23e7c4f125363c3117983b56415452b3bcb565e8e2f7/68747470733a2f2f706f7365722e707567782e6f72672f666c6573686772696e6465722f76616c75652f6c6963656e7365)](https://packagist.org/packages/fleshgrinder/value)[![Total Downloads](https://camo.githubusercontent.com/f35aedd31316ebcebb4681c98d7956c9791756c2873fb2258a36b500d481a295/68747470733a2f2f706f7365722e707567782e6f72672f666c6573686772696e6465722f76616c75652f646f776e6c6f616473)](https://packagist.org/packages/fleshgrinder/value)

Value
=====

[](#value)

Modern replacement for PHP’s [`gettype`](https://php.net/gettype) function.

- [Installation](#installation)
- [Usage](#usage)

Installation
------------

[](#installation)

Open a terminal, enter your project directory and execute the following command to add this package to your dependencies:

```
$ composer require fleshgrinder/value
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation.

Usage
-----

[](#usage)

The `Value` class currently contains a single static method called `getValue`and constants with the names of each of PHP’s types, corresponding to the values returned by the `getValue` method. There are currently no plans to extend this API and the following functionality is considered feature complete unless new types are added or old ones are removed.

```
