Spot the bug in the Job subclass

from Object-oriented programming
PHP 8.3.33 intermediate 4 min 1 issue to find

Find the initialization bug in this generated subclass.

php
class Job
{
    public function __construct(private string $id) {}

    public function id(): string
    {
        return $this->id;
    }
}

final class EmailJob extends Job
{
    public function __construct(private string $address) {}
}

echo (new EmailJob('[email protected]'))->id();
Open in playground
Report an error