Skip Navigation

[Resolved] Please re-open /topic/php-deprecated-notices-with-wp-5.5/

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 5 replies, has 2 voices.

Last updated by julieP 1 year ago.

Assigned support staff: Nigel.

Author
Posts
#1745199

Sorry was unable to get back to you before the robot closed this ticket.

When I originally upgraded to WordPress 5.5, I checked my site health notices and, as advised, upgraded to PHP 7.4. After your response to my original ticket, I rolled back WordPress (but not PHP) and I haven't had the original errors since. However, I have seen this deprecated notice a couple of times:-

PHP Deprecated:  array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /home/XXXXXX/public_html/wp-content/plugins/types/vendor/toolset/types/embedded/classes/class.wpcf-post-types.php on line 471

The array_key_exists function isn't deprecated. Is this error notice being thrown by Toolset or WordPress? Is Toolset compatible with PHP 7.4?

#1745369

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Julie

This is just a deprecation notice, so it shouldn't affect functionality now (though it could in the future).

I've just updated my test server to use PHP 7.4 and I'm not seeing that message in the logs.

Do you know what you do to provoke it?

#1748105

Hi Nigel

My point is that the function ISN'T deprecated and I've seen other users reporting odd notices when using PHP 7.4 which is why I'm asking if Toolset is throwing the error or WordPress and whether Toolset is compatible with PHP 7.4.

I believe this particular notice appeared when I created new Post Type. Does that help?

#1748185

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

No, the function isn't deprecated, but its use on objects is deprecated, that's what the error message produced by PHP describes.

I wasn't able to reproduce the notice, but studying the code in question it is easy enough to see why it is triggered (array_key_exists is called on an object rather than an array), and I've shared that with the developers so that it can be changed.

As I stated in my first reply, it is a deprecation notice, so doesn't currently have any effect on functionality, and doesn't mean Toolset is incompatible.

These kind of notices are fixed as and when they are discovered, either from user reports or from our internal testing.

#1753323

I've shared that with the developers so that it can be changed
thank you - this is what I was looking for you to tell me initially

#1753325

My issue is resolved now. Thank you!