Spot the bug in the optional chain

from PHP 8.0 features
PHP 8.3.33 intermediate 4 min 1 issue to find

Find why destination() can still warn when an Order object exists.

php
<?php
final class Address
{
    public function __construct(public string $city) {}
}
final class Customer
{
    public function __construct(public ?Address $address = null) {}
}
final class Order
{
    public function __construct(public ?Customer $customer = null) {}
}
function destination(?Order $order): string
{
    return $order?->customer->address?->city ?? 'pickup';
}
Open in playground
Report an error