Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7.2 compatibility issue #55

Closed
montaniasystemab opened this issue Aug 16, 2017 · 14 comments
Closed

PHP 7.2 compatibility issue #55

montaniasystemab opened this issue Aug 16, 2017 · 14 comments

Comments

@montaniasystemab
Copy link

In PHP 7.2 (tested with beta 2) there's an issue in the Request class:

count(): Parameter must be an array or an object that implements Countable

/…/vendor/phpxmlrpc/phpxmlrpc/src/Request.php:291

In PHP 7.2 you will no longer be able to send strings into count() so this needs to be changed in order to support PHP 7.2

Source: https://wiki.php.net/rfc/counting_non_countables

@HMAZonderland
Copy link
Contributor

HMAZonderland commented Aug 16, 2017

I think PHP7.2 support requires a whole new branch and version of this library. And dropping support for older PHP-versions.

@gggeek I guess supporting PHP7.2 goes hand in hand with #52.

@gggeek
Copy link
Owner

gggeek commented Sep 3, 2017

Btw, there's a bunch of other warnings as well, due to 'each' being deprecated...

@gggeek gggeek closed this as completed Sep 3, 2017
@gggeek
Copy link
Owner

gggeek commented Sep 3, 2017

Fixed in 4.2.1.

@HMAZonderland the fixes for supporting php 7.2 did not require any major change / hacks in regard to still supporting php 5.3. So we are not yet at needing the next 'big upgrade' :-)

@glensc
Copy link
Contributor

glensc commented Nov 11, 2017

@gggeek this issue is mentioned in 4.3.0 changelog: https://github.com/gggeek/phpxmlrpc/releases/tag/4.3.0

fixed: compatibility with Basic/Digest/NTLM auth when using client in cURL mode (issue #55)

but this has nothing to do with digest or curl mode. wrong ticket id in release notes?

@gggeek
Copy link
Owner

gggeek commented Nov 11, 2017

Thx for noticing, fixed the NEWS file. The correct ticket number is #58

@glensc
Copy link
Contributor

glensc commented Nov 12, 2017

please edit the release in github as well. thanks

@gggeek
Copy link
Owner

gggeek commented Nov 12, 2017

done

@sougatabose07
Copy link

I am having issue with each() too.

The each() function is deprecated. This message will be suppressed on further calls

For -

list($typ, $val) = each($this->me);

In -

vendor\phpxmlrpc\phpxmlrpc\src\Value.php

@gggeek
Copy link
Owner

gggeek commented Apr 16, 2019

@sougatabose07 which version of the library are you using? Version 4.2.1 or 4.3 should have fixed the problem

@sougatabose07
Copy link

@gggeek its the master branch I installed (4.3.1).

I have changed it to older version 3.1.1 and implementing only the lib/ files for now.

@strausmann
Copy link

strausmann commented May 26, 2019

@gggeek this is the Problem, can you fix that quickly? Thanks

lib/xmlrpc.inc:3183

* Return next member element for xmlrpcvals of type struct.
* @return xmlrpcval
* @access public
*/
function structeach()
{
	return each($this->me['struct']);
}```

@glensc
Copy link
Contributor

glensc commented May 26, 2019

@strausmann create new issue. don't comment on already solved tickets!

@gggeek
Copy link
Owner

gggeek commented May 27, 2019

@strausmann I can fix that by silencing the warning, and release version 4.3.2.

Having said that, I do encourage any users to move to the new api when using version 4 of the library and progressively abandon the compatibility layer.
The reason for that is that some class methods have been deprecated and will be dropped going forward, notably structeach.
In fact, I was thinking about having the code of the library emit deprecation warnings for any usage of deprecated functions, which would basically defeat the fix in 4.3.2, i.e. you would find yourself with more deprecation warnings in the logs, not less...

gggeek added a commit that referenced this issue May 27, 2019
@strausmann
Copy link

@gggeek Thank you. A better HowTo to use the v4 are very good. Incl. the Encoder Class ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants