WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#38144 closed defect (bug) (duplicate)

WP 4.6.1 getting an error in PHP 7.1

Reported by: hoang2016 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

Hello,
I tried installing WP 4.6.1 in with php 7.1.0 the site ran okay, but it shows 2 warning messages on the top of the font page and 3 messages in admin page

In the font page are: (2 messages)

Warning: Parameter 1 to wp_default_scripts() expected to be a reference, value given in my_web_root\wordpress\wp-includes\plugin.php on line 600

Warning: Parameter 1 to wp_default_styles() expected to be a reference, value given in my_web_root\wordpress\wp-includes\plugin.php on line 600

The code line in file like

call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));

In the admin site are (3 messages)

Warning: Parameter 1 to wp_default_scripts() expected to be a reference, value given in my_web_root\wordpress\wp-includes\plugin.php on line 600

Warning: Parameter 1 to wp_default_styles() expected to be a reference, value given in my_web_root\wordpress\wp-includes\plugin.php on line 600

Warning: Cannot assign an empty string to a string offset in my_web_root\wordpress\wp-includes\class.wp-scripts.php on line 447

The code line of first two messages as the same above
The code line for class.wp-script.php is

$l10n[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');

Any ideas or suggestions how to fix them it would be appreciated

Thank you,

In my wp-config.php; the define (‘WP_DEBUG’, false);

Change History (3)

#1 @jdgrimes
4 years ago

I've also noticed these errors during PHPUnit tests for one of my plugins, when run against PHP 7.1 on Travis CI. I haven't tried to track down the cause though.

#2 @ocean90
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Type changed from feature request to defect (bug)
  • Version 4.6.1 deleted

Hello @hoang2016, welcome to our Trac!

Thanks for your report. WordPress 4.6 isn't compatible with PHP 7.1 but WordPress 4.7 will be, see #37772.

#3 @hoang2016
4 years ago

Thank you for your advice

I tried install WP 4.7 (beta) as tester the problem had been solved

Before all you guy try to install WP 4.7 or update it later

I strong recommended that backup (fully),deactivate all plugins, and make a copy of wp-content foler

sincerely,

Hoang2016

Note: See TracTickets for help on using tickets.