PHP quiz · 35 questions

Constructor promotion

Read the code

What does this print?


<?php
class User {
    public function __construct(public string $name) {}
}

echo (new User("Ada"))->name;
  • 1–3 answer
  • ← previous
Question 9 of 3523%