PHPackages                             tadaspaplauskas/anyway - 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. tadaspaplauskas/anyway

ActiveLibrary

tadaspaplauskas/anyway
======================

Automatically switches the order of function arguments and retries in case of a TypeError.

1.0.0(3y ago)19MITPHPPHP ^8.0

Since Jul 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tadaspaplauskas/anyway)[ Packagist](https://packagist.org/packages/tadaspaplauskas/anyway)[ RSS](/packages/tadaspaplauskas-anyway/feed)WikiDiscussions main Synced 1mo ago

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

Anyway
======

[](#anyway)

[![Packagist Downloads](https://camo.githubusercontent.com/02edbfa25cbdcab83c32a49ad3af7b5e3437438850e221d3b4f4b49fe4311e46/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f74616461737061706c6175736b61732f616e79776179)](https://packagist.org/packages/tadaspaplauskas/anyway)

You've been working with PHP for years, yet still struggle to remember the order of arguments in functions like `in_array`, `array_map`, or `implode`? Don't worry, your struggles are finally over!

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

[](#installation)

```
composer require tadaspaplauskas/anyway
```

Getting started
---------------

[](#getting-started)

Quick! What's the first argument in the `in_array` function: array or value?

```
in_array([1, 2, 3], 2);

// TypeError
// in_array(): Argument #2 ($haystack) must be of type array, int given
```

You guessed wrong :(

Good thing that `Anyway` always knows what you meant:

```
use Anyway;

Anyway::in_array([1, 2, 3], 2);

// true

Anyway::in_array(4, [1, 2, 3]);

// false
```

`Anyway` will work with any function in the global space. Of course, if arguments don't make sense in any order, `Anyway` will still let you know about it:

```
use Anyway;

Anyway::in_array([1, 2, 3], fn () => 'what?');

// ErrorException
// Object of class Closure could not be converted to int
```

Limits
------

[](#limits)

The package works with functions that expect arguments of different types. For example, it will not work with `explode` or `strpos`, because both expected arguments are strings.

License
-------

[](#license)

This package is released under the MIT License. See LICENSE for details.

Disclaimer
----------

[](#disclaimer)

I know this is silly :). The package was [inspired by a tweet](https://twitter.com/aschmelyun/status/1549716246907654144), take it with a grain of salt. While it's pretty harmless and can be used in production, you might get some weird looks from teammates. Best to treat this as a joke in a package form.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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

Unknown

Total

1

Last Release

1388d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c7f09b58a1f5aceceb12e372e247b668321cfb2c24170f3949ed89eff42f3c5?d=identicon)[TadasPaplauskas](/maintainers/TadasPaplauskas)

---

Top Contributors

[![tadaspaplauskas](https://avatars.githubusercontent.com/u/5982246?v=4)](https://github.com/tadaspaplauskas "tadaspaplauskas (18 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tadaspaplauskas-anyway/health.svg)

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

PHPackages © 2026

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