Title: PHP Warning
Last modified: February 22, 2024

---

# PHP Warning

 *  [Malae](https://wordpress.org/support/users/malae/)
 * (@malae)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warning-477/)
 * Hello John,
 * Please take a look at the following:
 * `PHP Warning: Undefined array key "file" in /query-monitor/collectors/php_errors.
   php on line 364PHP Warning: Undefined array key "file" in /query-monitor/collectors/
   php_errors.php on line 364`
    -  This topic was modified 2 years, 3 months ago by [Malae](https://wordpress.org/support/users/malae/).

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

 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warning-477/#post-17445291)
 * Thanks. Are you able to identify the cause of this error? For example, which 
   URL does it occur on? Presumably this is triggered when a PHP error occurs on
   your site, do you know which error is causing it?
 * Thanks
 *  Thread Starter [Malae](https://wordpress.org/support/users/malae/)
 * (@malae)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warning-477/#post-17445841)
 * My apologies, I was not thinking clearly when I posted and the information was
   incomplete.
 * I have a site on a LAMP server where I am testing a plugin (not in the wordpress
   directory). It works fine except that it throws a fatal error if I open the Customizer.
   I was able to create the issue again and the details are as below.
 * The following from wp-debug:
 * `PHP Warning: Undefined array key "line" in /query-monitor/collectors/php_errors.
   php on line 364`
 * ` Fatal error: Uncaught TypeError: strnatcasecmp(): Argument #1 ($string1) must
   be of type string, array given in /wp-includes/class-wp-customize-widgets.php:
   1131
   Stack trace: 0 /wp-includes/class-wp-customize-widgets.php(1131): strnatcasecmp()
   1 [internal function]: WP_Customize_Widgets->_sort_name_callback() 2 /wp-includes/
   class-wp-customize-widgets.php(1050): usort() 3 /wp-includes/class-wp-customize-
   widgets.php(714): WP_Customize_Widgets->get_available_widgets() 4 /wp-includes/
   class-wp-hook.php(324): WP_Customize_Widgets->enqueue_scripts() 5 /wp-includes/
   class-wp-hook.php(348): WP_Hook->apply_filters() 6 /wp-includes/plugin.php(517):
   WP_Hook->do_action() 7 /wp-admin/customize.php(123): do_action() 8 {main}
 * `thrown in /wp-includes/class-wp-customize-widgets.php on line 1131`
 * Details as reflected in Query Monitor:
 * `Fatal error: Uncaught Error: strnatcasecmp(): Argument #1 ($string1) must be
   of type string, array given in /wp-includes/class-wp-customize-widgets.php on
   line 1131 Call stack: strnatcasecmp() wp-includes/class-wp-customize-widgets.
   php:1131 WP_Customize_Widgets::_sort_name_callback() usort() wp-includes/class-
   wp-customize-widgets.php:1050 WP_Customize_Widgets::get_available_widgets() wp-
   includes/class-wp-customize-widgets.php:714 WP_Customize_Widgets::enqueue_scripts()
   wp-includes/class-wp-hook.php:324 WP_Hook::apply_filters() wp-includes/class-
   wp-hook.php:348 WP_Hook::do_action() wp-includes/plugin.php:517 do_action() wp-
   admin/customize.php:123`

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

The topic ‘PHP Warning’ is closed to new replies.

 * ![](https://ps.w.org/query-monitor/assets/icon.svg?rev=2994095)
 * [Query Monitor](https://wordpress.org/plugins/query-monitor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/query-monitor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/query-monitor/)
 * [Active Topics](https://wordpress.org/support/plugin/query-monitor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/query-monitor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/query-monitor/reviews/)

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [Malae](https://wordpress.org/support/users/malae/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/php-warning-477/#post-17445841)
 * Status: not resolved