PHPackages                             alecrabbit/php-sneaky-peek - 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. alecrabbit/php-sneaky-peek

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

alecrabbit/php-sneaky-peek
==========================

Private and protected properties and methods accessors. NOT FOR PRODUCTION USE.

0.0.4(2y ago)07[5 PRs](https://github.com/alecrabbit/php-sneaky-peek/pulls)1MITPHPPHP &gt;=8.2

Since Mar 5Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (6)Versions (11)Used By (1)

🔭 PHP Sneaky Peek
=================

[](#-php-sneaky-peek)

[![PHP Version](https://camo.githubusercontent.com/c455a3c154de2a5b6f3a5d3d73121f58c69624f5a0edb43a86571e73f7afccbf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616c65637261626269742f7068702d736e65616b792d7065656b2f6465762d6d61696e2e737667)](https://php.net)[![Tests Status](https://github.com/alecrabbit/php-sneaky-peek/workflows/tests/badge.svg)](https://github.com/alecrabbit/php-sneaky-peek/actions)

[![Latest Stable Version](https://camo.githubusercontent.com/c03c67eb10b3ca83f25c8394ef3f92729351b3f644d7eb8e5373ea47c9e9921a/68747470733a2f2f706f7365722e707567782e6f72672f616c65637261626269742f7068702d736e65616b792d7065656b2f762f737461626c65)](https://packagist.org/packages/alecrabbit/php-sneaky-peek)[![Packagist Pre Release Version](https://camo.githubusercontent.com/666b7af88dc966512ae8fbca28c8ca181dbdc302436f8fddaa88d0cbeed14546/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f616c65637261626269742f7068702d736e65616b792d7065656b)](https://packagist.org/packages/alecrabbit/php-sneaky-peek)[![Latest Unstable Version](https://camo.githubusercontent.com/5ab3b4590b2fa86def3b18f45fcef908aaea31c0f182e3501f6431283fd711d4/68747470733a2f2f706f7365722e707567782e6f72672f616c65637261626269742f7068702d736e65616b792d7065656b2f762f756e737461626c65)](https://packagist.org/packages/alecrabbit/php-sneaky-peek)

[![License](https://camo.githubusercontent.com/dc6179675e10f0de10e646ac2641e74539669bd38ffb4329322181876d4bd38f/68747470733a2f2f706f7365722e707567782e6f72672f616c65637261626269742f7068702d736e65616b792d7065656b2f6c6963656e7365)](https://packagist.org/packages/alecrabbit/php-sneaky-peek)

A function to get a peek at private parts of an object.
-------------------------------------------------------

[](#a-function-to-get-a-peek-at-private-parts-of-an-object)

### Installation

[](#installation)

```
composer require --dev alecrabbit/php-sneaky-peek
```

> This package is intended for DEVELOPMENT purposes only.

### Usage

[](#usage)

```
class Awesome
{
    private $secret = '1234';

    protected function protectedMethod() {
        return 'protected';
    }

    protected static function protectedStaticMethod() {
        return 'protected static';
    }
}

// ...

peek(new Awesome())->secret; // '1234'
peek(new Awesome())->protectedMethod(); // 'protected'
```

In case you want to access static properties or methods you can pass FQCN as an argument instead of an object.

```
peek(Awesome::class)->protectedStaticMethod(); // 'protected static'
```

### How it is different from [spatie/invade](https://github.com/spatie/invade)?

[](#how-it-is-different-from-spatieinvade)

The main difference is `invade` can work with objects only, while `peek` can work with both objects and FQCN(class-string).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

Every ~0 days

Total

4

Last Release

794d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd47373a86071491b154326d2437fb6fb444ec02d87d22d7d203f67e1de6e5b5?d=identicon)[alecrabbit](/maintainers/alecrabbit)

---

Top Contributors

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

---

Tags

accessorconstantmethodphpprivatepropertyprotectedphpreflectionaccessorprivateprotected

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alecrabbit-php-sneaky-peek/health.svg)

```
[![Health](https://phpackages.com/badges/alecrabbit-php-sneaky-peek/health.svg)](https://phpackages.com/packages/alecrabbit-php-sneaky-peek)
```

###  Alternatives

[minime/annotations

The KISS PHP annotations library

229378.6k36](/packages/minime-annotations)

PHPackages © 2026

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