Title: Deprecated constructor call
Last modified: August 30, 2016

---

# Deprecated constructor call

 *  [Alhadis](https://wordpress.org/support/users/alhadis/)
 * (@alhadis)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/deprecated-constructor-call/)
 * Getting a deprecation error in PHP 7:
 * > <b>Deprecated:</b> Methods with the same name as their class will not be constructors
   > in a future version of PHP; RegenerateThumbnails has a deprecated constructor
   > in /path/to/wp/wp-content/plugins/regenerate-thumbnails/regenerate-thumbnails.
   > php on line 31
 * It’s easy enough to future-proof: simply renaming the constructor function from`
   RegenerateThumbnails` to the correct `__construct` should make everybody happy.
   🙂
 * [https://wordpress.org/plugins/regenerate-thumbnails/](https://wordpress.org/plugins/regenerate-thumbnails/)

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

 *  [DhillonMarty](https://wordpress.org/support/users/dhillonmarty/)
 * (@dhillonmarty)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/deprecated-constructor-call/#post-6505884)
 * Please could you guide us on where to make the change. Just learning to make 
   changes to the code. Thank you for your help.
 *  Thread Starter [Alhadis](https://wordpress.org/support/users/alhadis/)
 * (@alhadis)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/deprecated-constructor-call/#post-6505885)
 * Uhm. I said it’s the constructor function, which means line 35 of `regenerate-
   thumbnails.php` needs to change from this:
 *     ```
       // Plugin initialization
       function RegenerateThumbnails() {
       ```
   
 * Into this:
 *     ```
       // Plugin initialization
       function __construct() {
       ```
   
 * Make sense? =)

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

The topic ‘Deprecated constructor call’ is closed to new replies.

 * ![](https://ps.w.org/regenerate-thumbnails/assets/icon-128x128.png?rev=1753390)
 * [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/regenerate-thumbnails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/regenerate-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/regenerate-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/regenerate-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/regenerate-thumbnails/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Alhadis](https://wordpress.org/support/users/alhadis/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/deprecated-constructor-call/#post-6505885)
 * Status: not resolved