googleads-php-lib icon indicating copy to clipboard operation
googleads-php-lib copied to clipboard

change from deprecated ...set_option to set_options

Open Spirit-act opened this issue 8 months ago • 2 comments

In php8.4 stream_context_set_option no longer supports the signature with two arguments. Therefor the alternative function stream_context_set_options needs to be used.

source: https://www.php.net/manual/en/function.stream-context-set-option.php

~The Change is only slightly backwards compatible, because the new function was introduced in PHP8.3.~

Also implicitly marking parameters as nullable is deprecated.

The implicit nullable is only changed by files, which I use within my script, because only these I could validate.

Edit:

In the last commit a check for the PHP version was added. If the PHP version is greater or equal to PHP 8.3.0 stream_context_set_options is used. If the version is lower stream_context_set_option is used.

It feels a bit ugly, but i did not find a better solution for backwards compatibility.

Spirit-act avatar Apr 23 '25 11:04 Spirit-act

Looks like this will fix #805.

Any estimate date when this will be merged?

Thanks!!

ghnp5 avatar May 21 '25 22:05 ghnp5

Hey

Any estimate date when this will be merged?

Thanks!!

ghnp5 avatar Aug 19 '25 14:08 ghnp5

For anybody who needs it: I currently maintain a Fork on packagist until this is merged, or the error is fixed.

https://packagist.org/packages/spirit-act/googleads-php-lib

Spirit-act avatar Sep 23 '25 10:09 Spirit-act