Skip to content

Instantly share code, notes, and snippets.

@brianvarskonst
Created August 15, 2023 09:11
Show Gist options
  • Save brianvarskonst/9b6f949f2518c0f0973547bcc6443865 to your computer and use it in GitHub Desktop.
Save brianvarskonst/9b6f949f2518c0f0973547bcc6443865 to your computer and use it in GitHub Desktop.
Manipulate private property of instantiated object or class
<?php
$clone = clone $object;
(function () {
$this->changePrivateProperty = [];
})->call($clone);
return $clone;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment