Title: PHP issue with method substr
Last modified: May 27, 2024

---

# PHP issue with method substr

 *  [sfdeveloper](https://wordpress.org/support/users/sfdeveloper/)
 * (@sfdeveloper)
 * [2 years ago](https://wordpress.org/support/topic/php-issue-with-method-substr/)
 * In a latest php version there is an issue with the third argument for the method
   substr()
 * `PHP **Fatal** **error:** Uncaught TypeError: substr(): Argument #3 ($length)
   must be of type ?int, string given in /homepages/39/d173382052/htdocs/website-
   2021/wp-content/plugins/recent-posts-widget-plus/recent-posts-widget-plus.php:
   33`
 * Fixed it temporarily by casting $count to int (int)$count.

The topic ‘PHP issue with method substr’ is closed to new replies.

 * ![](https://ps.w.org/recent-posts-widget-plus/assets/icon-128x128.png?rev=2884178)
 * [Recent Posts Widget Plus](https://wordpress.org/plugins/recent-posts-widget-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/recent-posts-widget-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/recent-posts-widget-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/recent-posts-widget-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/recent-posts-widget-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/recent-posts-widget-plus/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [sfdeveloper](https://wordpress.org/support/users/sfdeveloper/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/php-issue-with-method-substr/)
 * Status: not resolved