We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following could be used to write private / protected properties without reflection. Could be faster.
https://3v4l.org/GqaLf
<?php final class Guard { private $x = 'test'; } $guard = new Guard(); $thief = function ($name) { return $this->$name; }; $hydrator = function ($name, $value) { $this->$name = $value; }; echo $thief->bindTo($guard, Guard::class)('x') . "\n"; $hydrator->bindTo($guard, Guard::class)('x', 'bla'); echo $thief->bindTo($guard, Guard::class)('x') . "\n";
See https://ocramius.github.io/blog/accessing-private-php-class-members-without-reflection/
The text was updated successfully, but these errors were encountered:
Should be benchmarked with current PHP versions.
Sorry, something went wrong.
No branches or pull requests
The following could be used to write private / protected properties without reflection. Could be faster.
https://3v4l.org/GqaLf
See https://ocramius.github.io/blog/accessing-private-php-class-members-without-reflection/
The text was updated successfully, but these errors were encountered: