protected function isPerfectNumber($number)
    {
        $d = 0;
        $max = \sqrt($number);
        for ($n = 2; $n <= $max; ++$n) {
            if (!($number % $n)) {
                $d += $n;
                if ($number / $n !== $n) {
                    $d += $number / $n;
                }
            }
        }

        return ++$d === $number;
    }
protected function isPerfectNumber($number)
    {
        $d = 0;
        $max = \sqrt($number);
        for ($n = 2; $n <= $max; ++$n) {
            if (!($number % $n)) {
                $d += $n;
                if ($number / $n !== $n) {
                    $d += $number / $n;
                }
            }
        }

        return ++$d === $number;
    }
protected function isPerfectNumber ( $ number ) { $ d = 0 ; $ max = \ sqrt ( $ number ) ; for ( $ n = 2 ; $ n <= $ max ; ++ $ n ) { if ( ! ( $ number % $ n ) ) { $ d += $ n ; if ( $ number / $ n !== $ n ) { $ d += $ number / $ n ; } } } return ++ $ d === $ number ; }
Test if a number is perfect or not.

Source: http://iceyboard.no-ip.org/projects/code/php/perfect_number/

@param int $number
The number to test

@return bool
The true if the number is perfect, false otherwise
Test if a number is perfect or not .