Commit 1ff9d22e authored by Anton Smirnov's avatar Anton Smirnov
Browse files

Document unset_private_field

parent cd5be89c
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2,6 +2,12 @@

## 3.x

### 3.1.0

*Apr 8, 2026*

* `unset_private_field()`

### 3.0.0

*Jan 14, 2023*
+2 −2
Original line number Diff line number Diff line
@@ -16,10 +16,11 @@ Use composer:

## Usage

These four simple functions can come in handy as helpers for something like [PsySH]
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()`

@@ -52,5 +53,4 @@ Please file issues on our main repo at GitLab: <https://gitlab.com/sandfox/php-p

The library is available as open source under the terms of the [MIT License].

[PsySH]: https://psysh.org/
[MIT License]: https://opensource.org/licenses/MIT
+14 −0
Original line number Diff line number Diff line
@@ -82,6 +82,20 @@ Set value of a private field
    set_private_field(A::class, 'staticSecret', 'new secret'); // set new A::$staticSecret value
    set_private_field([$a, B::class], 'secret', 'new secret'); // set new $a->B::$secret value

``unset_private_field``
---------------------

Unset value of a private field

.. code-block:: php

    <?php

    use function Arokettu\Debug\unset_private_field;

    unset_private_field($a, 'secret'); // unset new $a->A::secret value
    unset_private_field([$a, B::class], 'secret'); // unset new $a->B::$secret value

``call_private_method``
-----------------------