PHPackages                             php-kit/tools - 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. php-kit/tools

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

php-kit/tools
=============

A toolkit of utility functions for general use

3.0.0(1y ago)42.7k23MITPHP

Since Jan 20Pushed 6mo ago4 watchersCompare

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

READMEChangelogDependenciesVersions (10)Used By (3)

PHP-Kit Tools
=============

[](#php-kit-tools)

##### A toolkit of utility functions for general use

[](#a-toolkit-of-utility-functions-for-general-use)

What is PHP-Kit Tools?
----------------------

[](#what-is-php-kit-tools)

PHP-Kit Tools is an attempt to create a toolkit of general purpose helper / utility functions that can be reused between projects.

This toolkit provides missing functionality from the standard library and adds miscellaneous generic, low-level, foundational functions for making your code clearer and more succinct, reducing boilerplate and copy-paste.

Why PHP-Kit Tools?
------------------

[](#why-php-kit-tools)

There are some recurring functions and patterns that are needed frequently when developing any PHP project. So, developers frequently copy-paste the same own-made utility / helper functions over and over, from project to project.

### The problem

[](#the-problem)

- all that copy-pasted code is hard to organize, update and maintain, especially when being shared between projects;
- different developers (even in the same team and/or in the same project) create their own utility / helper functions, sometimes redundantly duplicating existing code, introducing subtle variations and/or generating confiusion between team mates;
- copy-pasted-modified code is usually badly documented, possibly bug-ridden and, being developer-specific, has no support (from other than the original developer);
- if you use the utility functions provided by a specific framework, you're limiting the reusability of your code and making it harder for you to switch to projects made with other frameworks.

### PHP-Kit Tools is a solution

[](#php-kit-tools-is-a-solution)

##### Usable on any PHP project

[](#usable-on-any-php-project)

A consistent set of tools at your disposal, ready for use, on any project.
All developers on a team/project can share the same functions and write code in a similar way.

##### Framework independant

[](#framework-independant)

Work with any framework, always using the same set of base functions.
Make your code easier to reuse.
Make it easier to switch to projects made with other frameworks, keeping the *way-you-work*.

> Some frameworks even use PHP-Kit Tools on their own code.

##### Documented

[](#documented)

Most functions already have a *doc-block* (inline documentation), so your IDE should give you inline documentation and parameter validation and autocompletion.

Nevertheless, additional documentation (to be displayed on this Readme or on the project's Wiki) is still being written, whenever we find the time for it.

Are you in a hurry? You can volunteer for writing documentation. We welcome your pull requests ;-)

##### Tested

[](#tested)

Automated tests are not implemented yet, but they're comming soon.

Nevertheless, this library is battle-tested on many real-world projects.

##### Supported

[](#supported)

Both the project creators and the community will keep this library updated, apply bug-fixes and implement new features, when needed.

##### Evolving

[](#evolving)

New functions may be added from time to time, or existing functions may be improved, or even removed (if we reach the conclusion that they are not useful enough for the majority of developers and use cases).

> The library will **not** grow endlessly to contain every possible utility/helper function in existence! **We only want the best / most useful / most needed functions here!**

##### But still stable enough

[](#but-still-stable-enough)

Don't worry about the possibility of your code breaking due to changes on this library. Just make sure you require a specific version of it on your project's `composer.json` file.

> Do not use `dev-master` as your version constraint on `composer.json`!

Usage
-----

[](#usage)

#### Installation

[](#installation)

On the command-line, type:

```
composer require php-kit/tools
```

#### Runtime requirements

[](#runtime-requirements)

- PHP &gt;= 5.4

#### Code organization

[](#code-organization)

On the project's `src` folder you'll find a separate file for each group of functions, grouped by theme / purpose / scope.

All functions are global, i.e. they have no namespace and they are always accessible anywhere on your application.

Most functions on this library have names that make them seem just like another predefined PHP function, thereby complementing the standard API with the missing functions we wished were there.

For instance, array functions have the `array_` prefix, string functions have the `str_` prefix, and so on.

FAQ
---

[](#faq)

#### Why are all functions global?

[](#why-are-all-functions-global)

As these are helper / utility / general purpose functions, they can (and will) be used anywhere on the host application, and very frequently.

The library is compatible with PHP 5.4, which means there is no easy way to import the functions into a file's namespace, and there is no autoloading capability (it only works for classes).

Either we transform these functions into class static methods, which will make calling then more verbose (and destroy the illusion of them being just an extension to the standard PHP global functions), or we raise the PHP version requirement to 5.6.

Even when using PHP &gt;= 5.6, always having to import each and every single function using `use` statements at the top of each source code file, is not the most practical / productive solution.

#### Aren't globals bad?

[](#arent-globals-bad)

Yes, globals have some problems.

The main disadvantage of using globals is that they *pollute* the global namespace and increase the probability of identifier collisions with functions from other libraries.

Nevertheless, PHP is known for having no shame in polluting the global namespace with thousands of functions, classes, variables and constants. So, we just keep the tradition, and extend it a little more. ;-)

Do note that many of our functions are named with a common prefix. For instance, array functions have the `array_` prefix, string functions have the `str_` prefix, and so on. This also reduces the probability of name collisions.

Also, some functions are wrapped in `if` blocks so that, if a function with the same name is already defined, no error will occur and the original function will be kept unmodified. Of course, in that case, you'll not be able to use the new function with the same name, but at least it will not prevent you from using other functions from this library.

> This conditional definition is, currently, reserved to functions with very common names, though (ex. `get`).

License
-------

[](#license)

This library is open-source software licensed under the [MIT license](http://opensource.org/licenses/MIT).

Copyright © 2015 Impactwave, Lda.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance51

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 96.5% 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 ~385 days

Recently: every ~658 days

Total

8

Last Release

703d ago

Major Versions

1.0.0 → 2.0.02017-02-24

2.3.1 → 3.0.02024-06-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/750f00fdbb8cb2fd1c11c5c26b512217451bb001ac48a77542efa7123b9e2124?d=identicon)[impactwave](/maintainers/impactwave)

---

Top Contributors

[![claudio-silva](https://avatars.githubusercontent.com/u/1999803?v=4)](https://github.com/claudio-silva "claudio-silva (139 commits)")[![goncalomartins](https://avatars.githubusercontent.com/u/19184021?v=4)](https://github.com/goncalomartins "goncalomartins (5 commits)")

---

Tags

utilityhelpers

### Embed Badge

![Health badge](/badges/php-kit-tools/health.svg)

```
[![Health](https://phpackages.com/badges/php-kit-tools/health.svg)](https://phpackages.com/packages/php-kit-tools)
```

###  Alternatives

[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[voku/arrayy

Array manipulation library for PHP, called Arrayy!

4875.5M16](/packages/voku-arrayy)[brandonwamboldt/utilphp

util.php is a collection of useful functions and snippets that you need or could use every day, designed to avoid conflicts with existing projects

1.0k538.8k12](/packages/brandonwamboldt-utilphp)[voku/stringy

A string manipulation library with multibyte support

1783.8M19](/packages/voku-stringy)[statamic/stringy

A string manipulation library with multibyte support, forked from @statamic

234.5M14](/packages/statamic-stringy)[tcb13/substringy

A sub string manipulation library with multibyte support that extends Stringy

1760.6k1](/packages/tcb13-substringy)

PHPackages © 2026

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