• Einar
    link
    fedilink
    arrow-up
    13
    arrow-down
    4
    ·
    edit-2
    1 year ago

    Recently there was a thread trying to declare PHP obsolete.

    Hard to beat this in efficiency:

    function is_even($num) {
        return $num % 2 === 0;
    }
    
    

    That said, this should work similarly in most languages.