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)64.1k2MITPHPPHP ~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 today

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 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

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

843d ago

PHP version history (3 changes)1.0.0PHP ^8.1

1.2.0PHP ~8.2

1.3.0PHP ~8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/59749?v=4)[Artem Loenko](/maintainers/dive)[@dive](https://github.com/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

[symfony/polyfill-intl-idn

Symfony polyfill for intl's idn\_to\_ascii and idn\_to\_utf8 functions

3.4k823.1M146](/packages/symfony-polyfill-intl-idn)[prestashop/hummingbird

Hummingbird development theme for PrestaShop

1293.5M4](/packages/prestashop-hummingbird)[codeigniter4/tasks

Task Scheduler for CodeIgniter 4

124177.3k1](/packages/codeigniter4-tasks)[crescat-io/saloon-sdk-generator

Simplified SDK Scaffolding for Saloon

13232.4k10](/packages/crescat-io-saloon-sdk-generator)

PHPackages © 2026

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