PHPackages                             artbit/isget - 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. artbit/isget

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

artbit/isget
============

This is a handy little helper function that is used to replace the common pattern of isset($a, $a\['b'\]) ? $a\['b'\] : $c; which can be ugly and redundant.

v1.0.0(10y ago)1611MITPHP

Since Oct 24Pushed 9y agoCompare

[ Source](https://github.com/ArtBIT/isget)[ Packagist](https://packagist.org/packages/artbit/isget)[ Docs](https://github.com/artbit/isget)[ RSS](/packages/artbit-isget/feed)WikiDiscussions master Synced 1w ago

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

isget() for PHP
===============

[](#isget-for-php)

[![Build Status](https://camo.githubusercontent.com/a697358a4945497d844a7331f915f27ddaf0f9ce2b088dfcb89cc7b0a634bed4/68747470733a2f2f7472617669732d63692e6f72672f4172744249542f69736765742e737667)](https://travis-ci.org/ArtBIT/isget) [![GitHub license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/ArtBIT/isget/master/LICENSE) [![GitHub issues](https://camo.githubusercontent.com/b1a1f8483795a322d6c9901a6f9904a65959c52994b2e84d410901e733e987f5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f4172744249542f69736765742e737667)](https://github.com/ArtBIT/isget/issues)

This is a handy little helper function that is used to replace the common pattern of `isset($a, $a['b']) ? $a['b'] : $c;` which can be ugly and redundant.

You can think of it as a long lost brother of `isset()`.

It does two things:

- It silences down the PHP Undefined index notice, when trying to access an inexistent key in an array
- And returns a default value if the key is not set

Usage
-----

[](#usage)

```
mixed isget(array $inputarray['somekey'], mixed $default_value)
```

If the `somekey` key is set, the function will return its value, if it's not, it will return the provided default value (or `false` by default);

It comes in really handy, if your function supports an array of options, and you don't want to worry about checking if the option has been set or not. i.e.

```
function do_something($required_param, $options = array()) {
    if (isget($options['forceint']) === true) {
        $required_param = intval($required_param);
    }
    if (isget($options['uppercase']) === true) {
        $required_param = strtoupper($required_param);
    }
    ...
    return $required_param;
}
$a = 12.34;
echo do_something($a);
// 12.34
echo do_something($a, array('forceint' => true));
// 12
```

If you need to go deeper, you can.

```
$dream = array();
echo isget($dream['within_a_dream']['within_a_dream']['within_a_dream']['...'], 'inception!');
// inception!
```

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

[](#installation)

The easiest way to install this library is to use Composer and add the following to your project's `composer.json` file:

```
{
    "require": {
        "artbit/isget": "dev-master"
    }
}
```

Then, when you run `composer install`, everything will fall magically into place, and the `isget()` function will be available to your project, as long as you are including Composer's autoloader.

*However, you do not need Composer to use this library.*

This library has no dependencies and should work on older versions of PHP. Download the code and include `src/isget.php` in your project, and all should work fine.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

3859d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/54927d0d649eaab56232a2a6f52d5bd5fc5a9e69a47112645b94c44d70d2d116?d=identicon)[ArtBIT](/maintainers/ArtBIT)

---

Top Contributors

[![ArtBIT](https://avatars.githubusercontent.com/u/184220?v=4)](https://github.com/ArtBIT "ArtBIT (8 commits)")

---

Tags

helperarrayutilityissetternary

### Embed Badge

![Health badge](/badges/artbit-isget/health.svg)

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

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[voku/arrayy

Array manipulation library for PHP, called Arrayy!

4875.5M16](/packages/voku-arrayy)[bocharsky-bw/arrayzy

A native PHP arrays easy manipulation library in OOP way.

38425.4k](/packages/bocharsky-bw-arrayzy)[spatie/array-functions

Some handy array helpers

24561.1k2](/packages/spatie-array-functions)[minwork/array

Pack of advanced array functions specifically tailored for: associative (assoc) array, multidimensional array, array of objects and handling nested array elements

66256.1k5](/packages/minwork-array)[brunoconte3/dev-utils

A complete PHP utility library for validating, formatting, comparing data, and more.

3525.7k](/packages/brunoconte3-dev-utils)

PHPackages © 2026

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