3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Proxy { private readonly string $property; } $proxy = new Proxy; $closure = function () { $this->property = 'foo'; }; $closure2 = $closure->bindTo($proxy, 'Proxy'); $closure2(); var_dump($proxy);
Output for 8.1.2 - 8.1.34, 8.2.23 - 8.2.30, 8.3.5 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
object(Proxy)#1 (1) { ["property":"Proxy":private]=> string(3) "foo" }

preferences:
54.96 ms | 720 KiB | 4 Q