class MyObject{
function __construct(private int $prop) {
}
}
$obj = new MyObject(123);
// Создать прокси объект
$proxyObj = new FriendProxy($obj);
// Вывести приватное свойство
echo $proxyObj->prop;
Вывод 123
class TestClass1
{
}
class TestClass2
{
public static function print() : void {
$items = Items::list(__FILE__);
var_dump($items);
}
}
TestClass2::print();
Вывод
[
'TestClass1',
'TestClass2',
]