PHPackages                             aelora/truthy - 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. aelora/truthy

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

aelora/truthy
=============

Add a simple isTruthy and isFalsy function to see if things are true-like or false-like

1.0.1(3y ago)091[1 PRs](https://github.com/RyanNutt/truthy/pulls)MITPHPPHP &gt;=7.0

Since Jul 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/RyanNutt/truthy)[ Packagist](https://packagist.org/packages/aelora/truthy)[ GitHub Sponsors](https://github.com/RyanNutt)[ RSS](/packages/aelora-truthy/feed)WikiDiscussions main Synced 1mo ago

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

[![](header.png)](header.png)

isTruthy / isFalsy
==================

[](#istruthy--isfalsy)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6659c46be21423219573a99a4a866d45cd38740945163da148aa7bf6c6959ce4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61656c6f72612f7472757468792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aelora/truthy)[![Total Downloads](https://camo.githubusercontent.com/56e74f85bbd3bcb414eea9631e0187082556dcbbde1ee5f00fca6c3d4e738274/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61656c6f72612f7472757468792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aelora/truthy)

Simple PHP package to add an `isTruthy` and `isFalsy` function.

And yes, I know this is simple to almost a silly level. But it's something that I found myself adding to a bunch of different PHP projects so it seemed like a perfect bit of code to build into a package.

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

[](#installation)

Install using composer

```
composer require aelora/truthy

```

There are no settings.

Usage
-----

[](#usage)

Once loaded, there will be an `isTruthy` and `isFalsy` function in the global namespace.

The following values are considered falsy

- false
- null
- empty string
- 0
- 0.0
- empty array
- empty object
- strings "no", "n", "false", "f", "off", "null", "0", "0.0"

Everything else is considered truthy.

```
if (isTruthy($value)) {
    // Do something
}
if (isFalsy($value)) {
    // Do something
}
```

Tests
-----

[](#tests)

```
composer test

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

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 ~0 days

Total

2

Last Release

1395d ago

PHP version history (2 changes)1.0.0PHP ^7.0

1.0.1PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/735c35e3efe6a08bafaf3b7ca05445de2244b9ffee4aa73f1b7fb8a1e3683c7c?d=identicon)[ryannutt](/maintainers/ryannutt)

---

Top Contributors

[![RyanNutt](https://avatars.githubusercontent.com/u/7416974?v=4)](https://github.com/RyanNutt "RyanNutt (3 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/aelora-truthy/health.svg)

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

###  Alternatives

[nexylan/slack-bundle

Symfony bundle integration of nexylan/slack library

1081.2M](/packages/nexylan-slack-bundle)[whitecube/php-prices

A simple PHP library for complex monetary prices management

17168.4k7](/packages/whitecube-php-prices)[binsoul/net-mqtt

MQTT protocol implementation

28897.8k7](/packages/binsoul-net-mqtt)[kotchuprik/yii2-sortable-widgets

Implementation Rubaxa/Sortable for Yii2. Sortable grid view inside.

61132.2k6](/packages/kotchuprik-yii2-sortable-widgets)[sulu/theme-bundle

The Sulu Bundle which provides theming functionality.

23300.4k1](/packages/sulu-theme-bundle)[wapmorgan/yii2-inflection

Inflection extension for Yii2. Support for English / Russian languages to inflect words / names / numbers / money / date&amp;time.

32112.3k](/packages/wapmorgan-yii2-inflection)

PHPackages © 2026

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