tpyo / amazon-s3-php-class

A standalone Amazon S3 (REST) client for PHP 5/CURL
1.03k stars 503 forks source link

openssl_free_key() is deprecated in PHP8 #178

Open stronk7 opened 2 years ago

stronk7 commented 2 years ago

From the php80 release notes:

. The openssl_x509_free() function is deprecated and no longer has an effect, instead the OpenSSLCertificate instance is automatically destroyed if it is no longer referenced. . The openssl_pkey_free() (and its alias openssl_free_key) function is deprecated and no longer has an effect, instead the OpenSSLAsymmetricKey instance is automatically destroyed if it is no longer referenced.

And there is a case of openssl_free_key() @ S3.php

Maybe it should be replaced to something like:

if (PHP_MAJOR_VERSION < 8) {
    openssl_free_key(self::$__signingKeyResource);
}
self::$__signingKeyResource = null;

Ciao :-)