Closed sodabrew closed 4 years ago
I think this is working now for PHP 7.3, but it still fails for PHP master. I'm waiting for https://github.com/travis-ci/travis-ci/issues/9717 to get a PHP 7.3 image on Travis CI.
I think I understand the crux of the problem. This module has always behaved incorrectly and the tests were configured to ensure incorrect behavior.
Given this recursive scenario:
$a = array(null);
$b = array(&$a);
$a[0] = &$b;
var_dump($a);
In all versions of PHP 7.x the output of var_dump
is:
array(1) {
[0]=>
&array(1) {
[0]=>
&array(1) {
[0]=>
*RECURSION*
}
}
}
The unit tests pack and unpack the variable to see how it goes through msgpack:
$serialized = msgpack_pack($a);
$unserialized = msgpack_unpack($serialized);
var_dump($unserialized);
The unit tests then expect to see the following output. Note the expectation of iterating the recursion exactly once, whereas PHP itself does not iterate the recursion at all as seen above:
array(1) {
[0]=>
array(1) {
[0]=>
array(1) {
[0]=>
array(1) {
[0]=>
array(1) {
[0]=>
NULL
}
}
}
}
}
Therefore I believe the correct fix is to change the unit tests to match the PHP 7.3 required behavior (i.e. no longer being able to check that we've been through the recursion just once, but rather only being able to check before the zero-th pass) and to change the code to operate the same way for PHP 7.0-7.2.
And there we have it, tests! Anybody around to code review now?
Hellooooo PHP 7.3.0 is released already. I'm a bit blocked on updating the memcached pecl module, unless I release-note that msgpack is no longer supported.
@sodabrew are you sure that msgpack unsupported?
@andypost it does not compile with 7.3
Any update on this PR?
I have tested this PR and the changes look good. Could we get this merged, please?
@laruence perhaps you’ve seen this PR since before you did similar work this week? Did I waste my time here?
Woo! It compiles! Tests are now failing in exactly the expected manner due to changes in PHP master: