Hard
What will be displayed?
<?php
class User
{
public string $name = 'Doe';
}
class Article
{
public ?User $user;
}
$article = new Article;
$article->user = new User;
$article?->user?->name = 'Dupont';
echo $article->user->name;
Author: W3D TeamStatus: PublishedQuestion passed 780 times
Edit
2
Community Evaluations
Similar QuestionsMore questions about PHP