protected function getHighestDiffUnitAndValue($diff)
    {
        // Manually define props due to Reflection Bug #53439 (PHP)
        $properties = array('y', 'm', 'd', 'h', 'i', 's');

        foreach($properties as $prop) {
            if ($diff->$prop > 0) {
                return array('unit' => $prop, 'value' => $diff->$prop);
            }
        }

        return array('unit' => 'now', 'value' => 0);
    }
protected function getHighestDiffUnitAndValue($diff)
    {
        // Manually define props due to Reflection Bug #53439 (PHP)
        $properties = array('y', 'm', 'd', 'h', 'i', 's');

        foreach($properties as $prop) {
            if ($diff->$prop > 0) {
                return array('unit' => $prop, 'value' => $diff->$prop);
            }
        }

        return array('unit' => 'now', 'value' => 0);
    }
protected function getHighestDiffUnitAndValue ( $ diff ) { // Manually define props due to Reflection Bug #53439 (PHP) $ properties = array ( 'y' , 'm' , 'd' , 'h' , 'i' , 's' ) ; foreach ( $ properties as $ prop ) { if ( $ diff -> $ prop > 0 ) { return array ( 'unit' => $ prop , 'value' => $ diff -> $ prop ) ; } } return array ( 'unit' => 'now' , 'value' => 0 ) ; }
Returns the highest unit and its value in a diff.

@param \DateInterval $diff
@return array
Returns the highest unit and its value in a diff .