0

I have version 8.1.3 of PHP and I am getting the following error message on Magento 2.4.4:

    Exception #0 (Exception): Deprecated Functionality: strtotime(): Passing null to parameter #1 ($datetime) 
of type string is deprecated in /data/web/magento2/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php on line 259

on the homepage, category pages etc. Have you faced this issue before ? Do you have any suggestions how to fix it ?

Thank you

2 Answers 2

0

I think you are missing both these things

  • PHP fpm all extensions
  • Composer version

You can also rename the vendor and update the composer.

2
  • not sure if what you said has any impact on the issue described. Can you add some more details ? Please note that on PHP 7.4 this doesn't occur. Jul 22, 2022 at 18:33
  • I think this link may be helpful for you: github.com/magento/magento2/issues/34531. You can also check my deleting the vendor directory and run the composer update. If it is a fresh installation, you can fix this issue by the above related solutions
    – Rana Zain
    Jul 22, 2022 at 20:41
0

Sorry i can't understand why this issue getting in core modules but i was facing same issue like PHP Deprecated: explode():. So i have found temporary solution for it.

Below is that us my issue solution.

$comp_uids = explode(',', $result['comp_uids'] ?? '');

And i am not sure about you issue but try below solution once time.

return strtotime($date) ?? '';

Check below links:

https://stackoverflow.com/questions/71707325/migration-to-php-8-1-how-to-fix-deprecated-passing-null-to-parameter-error-r

https://stackoverflow.com/questions/71097927/php-8-1-explode-passing-null-to-parameter-2-string-of-type-string-is-de

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.