Title: Deprecated function style in PHP 8
Last modified: April 17, 2023

---

# Deprecated function style in PHP 8

 *  Resolved [wp_edu](https://wordpress.org/support/users/alemao2k6/)
 * (@alemao2k6)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/deprecated-function-style-in-php-8/)
 * A warning is being thrown in debug.log all the time, after I have updated the
   server to PHP 8:
   [17-Apr-2023 01:40:04 UTC] PHP Deprecated: Required parameter
   $route follows optional parameter $code in *wp-home*/wp-content/plugins/license-
   manager-for-woocommerce/includes/abstracts/RestController.php on line 25

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

 *  [M Haseeb](https://wordpress.org/support/users/haseeb0001/)
 * (@haseeb0001)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/deprecated-function-style-in-php-8/#post-16661189)
 * Hi [@alemao2k6](https://wordpress.org/support/users/alemao2k6/)
 * I hope you are doing well.
 * Let me check and fix this issue in our upcoming release.
 * Thanks and regards,
   Support Team – WPExperts
 *  Thread Starter [wp_edu](https://wordpress.org/support/users/alemao2k6/)
 * (@alemao2k6)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/deprecated-function-style-in-php-8/#post-16678698)
 * For the moment, I’m fixing this by changing the following code in line 25:
 *     ```wp-block-code
       protected function response($success, $data, $code = 200, $route)
           {
               return new WP_REST_Response(...
       ```
   
 * With:
 *     ```wp-block-code
       protected function response($success, $data, $code, $route)
           { 
                if ( $code == null ){
                     $code = 200;
                }
               return new WP_REST_Response(...
       ```
   
 * Please let me know if you think it will generate any problems on lmfwc.
 * Thanks,
   Edu
 *  [M Haseeb](https://wordpress.org/support/users/haseeb0001/)
 * (@haseeb0001)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/deprecated-function-style-in-php-8/#post-16688916)
 * [@alemao2k6](https://wordpress.org/support/users/alemao2k6/) Its okay, it won’t
   cause any problems.
 * Thanks
 *  Thread Starter [wp_edu](https://wordpress.org/support/users/alemao2k6/)
 * (@alemao2k6)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/deprecated-function-style-in-php-8/#post-16689905)
 * Thanks!

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

The topic ‘Deprecated function style in PHP 8’ is closed to new replies.

 * ![](https://ps.w.org/license-manager-for-woocommerce/assets/icon-256x256.gif?
   rev=2824216)
 * [License Manager for WooCommerce](https://wordpress.org/plugins/license-manager-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/license-manager-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/license-manager-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/license-manager-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/license-manager-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/license-manager-for-woocommerce/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [wp_edu](https://wordpress.org/support/users/alemao2k6/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/deprecated-function-style-in-php-8/#post-16689905)
 * Status: resolved