Easy
What will this code display?
<?php
class MyAwesomeClass
{
public function __construct(public string|null $name = null){}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
}
echo (new MyAwesomeClass())->setName('My awesome name')->name;
Author: JérômeStatus: PublishedQuestion passed 37 times
Edit