PHPackages                             jesseschalken/hack-utils - 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. jesseschalken/hack-utils

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

jesseschalken/hack-utils
========================

v0.1(9y ago)7841MITHack

Since Sep 20Pushed 9y ago2 watchersCompare

[ Source](https://github.com/jesseschalken/hack-utils)[ Packagist](https://packagist.org/packages/jesseschalken/hack-utils)[ RSS](/packages/jesseschalken-hack-utils/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

hack-utils
==========

[](#hack-utils)

Type safe wrappers for PHP functions for usage with [Hack](http://hacklang.org/), with the following objectives:

- Be completely and accurately statically typed
- Interoperate smoothly with PHP &gt;= 5.3 via `h2tp   --no-collections`
- Prefer PHP arrays over Hack collections so the library is natural to use from PHP
- Where possible, provide simpler or more useful semantics than stock PHP APIs
    - Throw exceptions in the case of error instead of returning `false` or requiring the caller to check a `_last_error()` function
    - Use a consistent parameter order with the subject (`$this` if the function were a method) as the first parameter
- Cover the core set of functionality that common Hack/PHP programs require

The library functions like any other Composer package and does not require `hhvm` or `h2tp` to be installed to be used. When modifying this library, rebuild the PHP code with [`./build.bash`](./build.bash).

Functions are provided for

- [strings](./hack/main.php) *(find, repeat, replace, slice, splice, chunk, trim, pad, reverse, split, join, [is\_alnum](./hack/ctype.php), ..., to/from hex, encode/decode utf8, ...)*
- [arrays](./hack/main.php), both associative and sequentially indexed *(concat, push, pop, shift, unshift, range, filter, map, reduce, concat\_map, group-by, combine, flip, transpose, union, intersect, diff, select, zip, unzip, reverse, shuffle, chunk, repeat, slice, splice, find, [sort](./hack/sort.php), ...)*
- [ints/floats](./hack/math.php) *(max, min, abs, ceil, floor, trunc, frac, round, signbit, exp, pow, log, sum, product, sin, cos, tan, sinh, ...)*
- [Date/Time](./hack/DateTime.php) *(parse, format, get parts, from parts, ...)*
- [JSON](./hack/json.php) *(encode, decode)*
- [PCRE regular expressions](./hack/PCRE.php) *(match, match all, split, replace, quote)*

Browse the source code in the [`hack/`](./hack/) directory.

Functions have simple verbal names. Where a different use of the same verb is needed for different types (sequential array, associative array, string), the less common versions are suffixed with `_string`, `_array` or `_assoc` as appropriate. For example, `chunk` (for arrays), `chunk_string`, `chunk_assoc`.

Symbols prefixed with `_` are private and should not be referenced from outside the library.

TODO:

- Filesystem (fopen, scandir, unlink, ...)
- Command execution (proc\_open, ...)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

3570d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1559204?v=4)[Jesse Schalken](/maintainers/jesseschalken)[@jesseschalken](https://github.com/jesseschalken)

---

Top Contributors

[![jesseschalken](https://avatars.githubusercontent.com/u/1559204?v=4)](https://github.com/jesseschalken "jesseschalken (229 commits)")

### Embed Badge

![Health badge](/badges/jesseschalken-hack-utils/health.svg)

```
[![Health](https://phpackages.com/badges/jesseschalken-hack-utils/health.svg)](https://phpackages.com/packages/jesseschalken-hack-utils)
```

PHPackages © 2026

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