<?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";
You have javascript disabled. You will not be able to edit any code.