Spot the bug in the quantity parser

from Data types
PHP 8.3.33 beginner 4 min 1 issue to find

Find why this request parser accepts missing and malformed quantities as valid data.

php
<?php
function requestQuantity(array $input): int
{
    return (int) ($input['quantity'] ?? null);
}
Open in playground
Report an error