-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarDumper] Adapt to php 7.2 changes #23662
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
Conversation
@nicolas-grekas I suggest adding |
I think we have a policy of not adding anything to allowed failures, because that consumes a Travis job, and nobody cares checking what's there. In the past, I usually opened a PR adding that kind of line and fixing the code to make it green, and maintained that PR until it was ready for merge as a non-allowed-failure line (which is not something I'd like to do with this PR :) .) |
This PR was merged into the 2.7 branch. Discussion ---------- [VarDumper] Adapt to php 7.2 changes | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As required by this change on PHP 7.2: https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts Tests pass locally (until we add 7.2 to Travis) Commits ------- 3c2f5f7 [VarDumper] Adapt to php 7.2 changes
@@ -54,7 +54,7 @@ public static function castObject($obj, \ReflectionClass $reflector) | |||
if ($a) { | |||
$p = array_keys($a); | |||
foreach ($p as $i => $k) { | |||
if (isset($k[0]) && "\0" !== $k[0] && !$reflector->hasProperty($k)) { | |||
if (isset($k[0]) ? "\0" !== $k[0] && !$reflector->hasProperty($k) : \PHP_VERSION_ID >= 70200) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolas-grekas is there any need of writing such agly assertions? ;) I think some brackets would help in reading this code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always try to improve my style, a never ending story, thanks for pointing :)
As required by this change on PHP 7.2:
https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts
Tests pass locally (until we add 7.2 to Travis)