empty-php
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

Empty PHP

Build Status

The purpose of this library is to be a zero dependency and exact replica of the PHP empty function.

According to the PHP documentation, the following values are considered to be empty:

  • "" (an empty string)
  • 0 (0 as an integer)
  • 0.0 (0 as a float)
  • "0" (0 as a string)
  • NULL
  • FALSE
  • array() (an empty array)

Installation

Install with your favorite package manager:

npm install --save empty-php

Usage

To use the library:

import { empty } from "empty-php";

if (empty(myVar)) {
    // It's empty
}

Versioning

This project complies with Semantic Versioning.

Changelog

For a complete list of changes, and how to migrate between major versions, see releases page.

Package Sidebar

Install

npm i empty-php

Weekly Downloads

33

Version

3.0.1

License

MIT

Unpacked Size

24.9 kB

Total Files

10

Last publish

Collaborators

  • nekm