PHPackages                             tebru/realtype - 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. tebru/realtype

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

tebru/realtype
==============

Get the real type from a string

v0.1.4(9y ago)111.8k↓50%1MITPHPPHP &gt;=5.3

Since Feb 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/tebru/realtype)[ Packagist](https://packagist.org/packages/tebru/realtype)[ RSS](/packages/tebru-realtype/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (6)Used By (1)

[![Build Status](https://camo.githubusercontent.com/7847af41e0895a96fafeb78c36bd9a8b100d4deb823e6125591a75a35aced893/68747470733a2f2f7472617669732d63692e6f72672f74656272752f7265616c747970652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tebru/realtype)[![Coverage Status](https://camo.githubusercontent.com/6c1c584589fcff273e489e81cb21da93a4fe6d930635c5412d3be55c7227d414/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f74656272752f7265616c747970652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/tebru/realtype?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9d2deb2004ce0c398cc837499543236e9aecb5dab43ad401d5b741c737272968/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74656272752f7265616c747970652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tebru/realtype/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/08a7d51a5e0188b6831e84eeb49753cfd18adc2b7803afbb87ceda8f2be96472/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39666433396361302d643833652d343766392d386330362d3936363536616231343631632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/9fd39ca0-d83e-47f9-8c06-96656ab1461c)

Realtype
========

[](#realtype)

A PHP library that gets the real type from a string. Sometimes doubles, integers, or booleans will exist inside a string. This library determines what type it really is and returns that.

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

[](#installation)

```
composer require tebru/realtype

```

Usage
-----

[](#usage)

```
\Tebru\Realtype\Realtype::get('2.2'); // returns 2.2
\Tebru\Realtype\Realtype::get('2.0'); // returns 2.0
\Tebru\Realtype\Realtype::get('2'); // returns 2
\Tebru\Realtype\Realtype::get('0'); // returns 0
\Tebru\Realtype\Realtype::get('true'); // returns true
\Tebru\Realtype\Realtype::get('false'); // returns false
\Tebru\Realtype\Realtype::get('string'); // returns 'string'
\Tebru\Realtype\Realtype::get(2.2); // returns 2.2

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~55 days

Total

5

Last Release

3517d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1831497?v=4)[Nate Brunette](/maintainers/natebrunette)[@natebrunette](https://github.com/natebrunette)

---

Top Contributors

[![natebrunette](https://avatars.githubusercontent.com/u/1831497?v=4)](https://github.com/natebrunette "natebrunette (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tebru-realtype/health.svg)

```
[![Health](https://phpackages.com/badges/tebru-realtype/health.svg)](https://phpackages.com/packages/tebru-realtype)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
