TGM PHP 8 errors

I can confirm, TGM is not working with PHP 8. I get the same error like

I think this is a critical error, because a lot of themes on Envato use TGM, because TGM is recommended by Envato to use it.

errors
Passing null to parameter #3 ($subject) of type array|string is deprecated in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\formatting.php on line 5385

Deprecated : preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\formatting.php on line 5385
Deprecated : Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\Requests\Cookie\Jar.php on line 63

Deprecated : Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\Requests\Cookie\Jar.php on line 73

Deprecated : Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\Requests\Cookie\Jar.php on line 89

Deprecated : Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\Requests\Cookie\Jar.php on line 102

Deprecated : Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\Requests\Cookie\Jar.php on line 111

Deprecated : Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\Requests\Utility\CaseInsensitiveDictionary.php on line 40

Deprecated : Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\Requests\Utility\CaseInsensitiveDictionary.php on line 51

Deprecated : Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\Requests\Utility\CaseInsensitiveDictionary.php on line 68

Deprecated : Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\Requests\Utility\CaseInsensitiveDictionary.php on line 82

Deprecated : Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-includes\Requests\Utility\CaseInsensitiveDictionary.php on line 91

Deprecated : Automatic conversion of false to array is deprecated in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-content\themes\traveler\inc\st-hook-functions.php on line 2048

Deprecated : Automatic conversion of false to array is deprecated in C:\WEB\laragon\www\TRAVELAROUNDWORLDWIDE\wp-content\themes\traveler\inc\st-hook-functions.php on line 2048

Hi,

Contact with your purchase item author hope they will helped!

Thanks!

1 Like

Just wanted to quickly add more details from a programming standpoint. What you see are not errors, but deprecation notices. They indicate that the affected code will stop working in a future major language version (like PHP 9 or 10), but at the moment the code is correct and fully functional, so there is not much obligation to address them immediately.

Under normal circumstances you should never see deprecation notices appearing on your website, so something is not configured properly. Do you have debug mode enabled in WordPress by chance?

You can send these notices to the author, but the point where they will actually become a problem is still many years away. With some of the massive changes coming up in PHP 9, you will almost certainly see more of these pop up.

Oh, and to follow that up, it actually looks like most of the notices are coming from WordPress itself. Are you running the latest version? If so, then you’ll need to ignore them and wait until the WordPress team addresses it.

Only the last two notices are coming from your theme (traveler) and do not appear related to TGM specifically.

Thanks for your answers, I already wrote to the author, but I wanted to know if these errors were due to another source, because it cannot be that I installed it in several projects to test where the error was and it kept coming up. Thank you all very much for your time and responses.

1 Like