Title: PHP Deprecated code
Last modified: December 7, 2020

---

# PHP Deprecated code

 *  [Malae](https://wordpress.org/support/users/malae/)
 * (@malae)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/php-deprecated-code/)
 * Hello,
    The following Deprecated PHP thrown in PHP 7.4. Can you please fix them.
 *     ```
       PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; cw_axmascount has a deprecated constructor in /wp-content/plugins/santas-christmas-countdown/xmascount.php on line 68
       PHP Deprecated:  Function create_function() is deprecated in /wp-content/plugins/santas-christmas-countdown/xmascount.php on line 111
       PHP Deprecated:  The called constructor method for WP_Widget in cw_axmascount is <strong>deprecated</strong> since version 4.3.0! Use <code>__construct()</code> instead. in /wp-includes/functions.php on line 4870
       ```
   

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

 *  Thread Starter [Malae](https://wordpress.org/support/users/malae/)
 * (@malae)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/php-deprecated-code/#post-13762931)
 * The deprecated PHP was flooding the wp-debug.log file and it grew to > 1 MB in
   a few days. I looked at the deprecated code and found three lines that need updating,
   after which. the plugin is now OK. If anybody is interested I will be happy to
   share the new code.
 *  [alicewarcup](https://wordpress.org/support/users/alicewarcup/)
 * (@alicewarcup)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-code/#post-14009217)
 * I have been using this plugin, I would be interested in the updated code.
 *  Thread Starter [Malae](https://wordpress.org/support/users/malae/)
 * (@malae)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-code/#post-14011204)
 * @ alicewarcu
 * I hope this will fix your problem, but take no responsibility for any issues 
   that may arise.
 * Please replace the deprecated lines, as shown below:
 * Line 68 `function cw_axmascount()` is deprecated and should be replaced with:
 *     ```
       class cw_axmascount extends WP_Widget {
           function __construct()
       ```
   
 * Line 111 `add_action( 'widgets_init', create_function('', 'return register_widget("
   cw_axmascount");') );` is deprecated and should be replaced with:
 * `add_action( 'widgets_init', function(){return register_widget("cw_axmascount");});`
 *  [alicewarcup](https://wordpress.org/support/users/alicewarcup/)
 * (@alicewarcup)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-code/#post-14091424)
 * Thank you 🙂

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

The topic ‘PHP Deprecated code’ is closed to new replies.

 * ![](https://ps.w.org/santas-christmas-countdown/assets/icon-256x256.png?rev=980709)
 * [Christmas Countdown Widget](https://wordpress.org/plugins/santas-christmas-countdown/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/santas-christmas-countdown/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/santas-christmas-countdown/)
 * [Active Topics](https://wordpress.org/support/plugin/santas-christmas-countdown/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/santas-christmas-countdown/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/santas-christmas-countdown/reviews/)

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [alicewarcup](https://wordpress.org/support/users/alicewarcup/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-code/#post-14091424)
 * Status: not resolved