FL
например был объект
$student = new Student($firstname, $lastname, $course );
$json = json_encode($student);
а теперь захотел обратиться к его имени
можно ли делать так
$json->name
или как возможно без json_decode?Size: a a a
FL
$student = new Student($firstname, $lastname, $course );
$json = json_encode($student);
$json->name
или как возможно без json_decode?FL
$student = new Student($firstname, $lastname, $course );
$json = json_encode($student);
$json->name
или как возможно без json_decode?
class FuckMe {
private object $json;
public function __construct(string $json) {
$this->json = json_decode($json);
}
public function __get($name) {
return $this->json->{$name};
}
}
class Student {
public string $firstname;
public function __construct(string $firstname) {
$this->firstname = $firstname;
}
}
$student = new Student('Fuck me!!!!');
$json = new FuckMe(json_encode($student));
echo $json->firstname;
T🐜
DB
DB
DB
DB
V
V
AB
FL
ПГ
АГ
AB
АГ
FL
FL
АГ
АГ