PHPackages                             arokettu/private-access - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. arokettu/private-access

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

arokettu/private-access
=======================

Simple and fast methods to read private properties and call private methods

3.1.0(2mo ago)66.5k↑342.9%3MITPHPPHP &gt;= 5.6CI failing

Since Nov 16Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/arokettu/php-private-access)[ Packagist](https://packagist.org/packages/arokettu/private-access)[ Docs](https://sandfox.dev/php/private-access.html)[ RSS](/packages/arokettu-private-access/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (9)Versions (10)Used By (3)

PHP Private Access
==================

[](#php-private-access)

[![Packagist](https://camo.githubusercontent.com/fcab6cd6ee86018b00fed7d02242201ee7149ce863b7ef513e9369bdc71b8704/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61726f6b657474752f707269766174652d6163636573732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arokettu/private-access)[![License](https://camo.githubusercontent.com/6dfa10d354fbc2b365d7bfceb21b9bf240c5ef2a66d91bccff173abca4ba0916/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61726f6b657474752f707269766174652d6163636573732e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)[![Gitlab pipeline status](https://camo.githubusercontent.com/b7b64fc2064c37c7287e4efe14ef3a9e5b895832f3efeebadc9d862e5f6c763c/68747470733a2f2f696d672e736869656c64732e696f2f6769746c61622f706970656c696e652f73616e64666f782f7068702d707269766174652d6163636573732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://gitlab.com/sandfox/php-private-access/-/pipelines)

A small simple library to access private properties of the objects. Actually it's more an example of mad skillz than a useful tool. No Reflection API calls!

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

[](#installation)

Use composer:

```
composer require arokettu/private-access --dev

```

Usage
-----

[](#usage)

These simple functions can come in handy as helpers for some development or test code.

- `get_private_field()`
- `set_private_field()`
- `unset_private_field()`
- `call_private_method()`
- `get_private_const()`

Example
-------

[](#example)

```
