PHPackages                             dive-be/php-crowbar - 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. dive-be/php-crowbar

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

dive-be/php-crowbar
===================

Access private methods / properties

1.3.0(2y ago)63.7k2MITPHPPHP ~8.3

Since Apr 2Pushed 2y agoCompare

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

READMEChangelog (4)DependenciesVersions (5)Used By (2)

[![Social Card of PHP Crowbar](https://github.com/dive-be/php-crowbar/raw/master/art/socialcard.jpg?raw=true)](https://github.com/dive-be/php-crowbar/blob/master/art/socialcard.jpg?raw=true)

Access private methods / properties
===================================

[](#access-private-methods--properties)

[![Latest Version on Packagist](https://camo.githubusercontent.com/17096b50e4e65a418801eceb7f4a7a5eeae99f231137c30c4a62de3918b8fff4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646976652d62652f7068702d63726f776261722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dive-be/php-crowbar)[![GitHub Tests Action Status](https://camo.githubusercontent.com/35926b8d1d09a972d26e72f62a210ac4de0a2f501fcc1d169bc1c5bbb7be3363/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f646976652d62652f7068702d63726f776261722f54657374733f6c6162656c3d7465737473)](https://github.com/dive-be/php-crowbar/actions?query=workflow%3ATests+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/389898db82fa3ba1a2176d16f54a540c01aef76f16d788d2094e86f65bd06825/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646976652d62652f7068702d63726f776261722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dive-be/php-crowbar)

This package allows you to access methods / properties in a class with a restricted access modifier i.e. `private` / `protected`.

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

[](#installation)

You can install the package via composer:

```
composer require dive-be/php-crowbar
```

Usage
-----

[](#usage)

Assume the following class with a `private` property. It offers no way to read / write its `$content` property.

```
class SealedCrate
{
    public function __construct(
        private string $content,
    ) {}

    private function peek(): string
    {
        return $this->content;
    }
}

$crate = new SealedCrate('Apples');
```

You can get the property using the `Crowbar`:

```
Crowbar::pry($crate)->content; // Apples
```

You can set the property:

```
Crowbar::pry($crate)->content; // Original: Apples

Crowbar::pry($crate)->content = 'Strawberries';

Crowbar::pry($crate)->content; // Altered: Strawberries
```

You can also invoke private methods:

```
Crowbar::pry($crate)->peek(); // Strawberries
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Muhammed Sari](https://github.com/mabdullahsari)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

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

Every ~237 days

Total

4

Last Release

796d ago

PHP version history (3 changes)1.0.0PHP ^8.1

1.2.0PHP ~8.2

1.3.0PHP ~8.3

### Community

Maintainers

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

---

Top Contributors

[![mabdullahsari](https://avatars.githubusercontent.com/u/24608797?v=4)](https://github.com/mabdullahsari "mabdullahsari (3 commits)")

### Embed Badge

![Health badge](/badges/dive-be-php-crowbar/health.svg)

```
[![Health](https://phpackages.com/badges/dive-be-php-crowbar/health.svg)](https://phpackages.com/packages/dive-be-php-crowbar)
```

###  Alternatives

[fntneves/laravel-transactional-events

Transaction-aware Event Dispatcher for Laravel

3202.6M2](/packages/fntneves-laravel-transactional-events)[ipinfo/ipinfo

The official PHP library for IPinfo, the most reliable, accurate, and in-depth source of IP address data available anywhere. We process terabytes of data to produce our custom IP geolocation, company, carrier and IP type data sets. Visit our developer docs at https://ipinfo.io/developers.

2891.2M11](/packages/ipinfo-ipinfo)[typo3/cms-recordlist

TYPO3 CMS Recordlist - Lists database records in the TYPO3 backend module (Web&gt;List).

178.0M48](/packages/typo3-cms-recordlist)[neos/eel

The Embedded Expression Language (Eel) is a building block for creating Domain Specific Languages

122.0M27](/packages/neos-eel)

PHPackages © 2026

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