• parpol@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    4 days ago

    For almost the same reason don’t use isset()

    Isset(0) is false. Use !== null.

    Use empty() for arrays only, Use isset() for nullable objects (not datatypes) only, Use array_key_exists() for checking if the element exists in the array.

    Also, don’t use empty() on Laravel Collections, use the built in isEmpty() methods because empty() will always be false.