Title: Returning bool from comparison function is deprecated
Last modified: June 20, 2022

---

# Returning bool from comparison function is deprecated

 *  Resolved [OreilleMalade](https://wordpress.org/support/users/oreillemalade/)
 * (@oreillemalade)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/returning-bool-from-comparison-function-is-deprecated/)
 * Hi,
 * Thanks again for your plugin, I’m totally in love with it!
 * I’m debugging some websites and saw that several times in the logs:
    PHP Deprecated:
   usort(): Returning bool from comparison function is deprecated, return an integer
   less than, equal to, or greater than zero in /home/XXX/public_html/wp-content/
   plugins/custom-related-posts/helpers/output.php on line 27
 * Any idea?
    Best Regards
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Freturning-bool-from-comparison-function-is-deprecated%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Brecht](https://wordpress.org/support/users/brechtvds/)
 * (@brechtvds)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/returning-bool-from-comparison-function-is-deprecated/#post-15753047)
 * Thanks for letting me know. I’ll make sure that’s fixed in the next update!
 *  [zecompadre](https://wordpress.org/support/users/zecompadre/)
 * (@zecompadre)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/returning-bool-from-comparison-function-is-deprecated/#post-15947320)
 * PHP 8.0 related issue
 * [https://stackoverflow.com/questions/65382799/what-happened-in-php8-0-0-to-break-usort-intstrlenastrlenb](https://stackoverflow.com/questions/65382799/what-happened-in-php8-0-0-to-break-usort-intstrlenastrlenb)
    -  This reply was modified 3 years, 9 months ago by [zecompadre](https://wordpress.org/support/users/zecompadre/).
 *  Plugin Author [Brecht](https://wordpress.org/support/users/brechtvds/)
 * (@brechtvds)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/returning-bool-from-comparison-function-is-deprecated/#post-15986598)
 * Hi again,
 * I wanted to let you know I just released Custom Related Posts 1.7.0 which should
   prevent the PHP 8 deprecation warning from showing up.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Returning bool from comparison function is deprecated’ is closed to new
replies.

 * ![](https://ps.w.org/custom-related-posts/assets/icon-256x256.png?rev=2007814)
 * [Custom Related Posts](https://wordpress.org/plugins/custom-related-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-related-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-related-posts/reviews/)

## Tags

 * [PHP Deprecated](https://wordpress.org/support/topic-tag/php-deprecated/)

 * 3 replies
 * 3 participants
 * Last reply from: [Brecht](https://wordpress.org/support/users/brechtvds/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/returning-bool-from-comparison-function-is-deprecated/#post-15986598)
 * Status: resolved