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

Clarify array_diff_(u)assoc examples #2650

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

alexandre-daubois
Copy link
Contributor

Fix #2631

My last try to clarify this wasn't the good fix. I try here to clarify what happens with array_diff_(u)assoc and why red is present in the output.

@@ -80,11 +80,13 @@
<example>
<title><function>array_diff_uassoc</function> example</title>
<para>
The <literal>"a" =&gt; "green"</literal>
In this example you see the <literal>"a" =&gt; "green"</literal>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this example you see the <literal>"a" =&gt; "green"</literal>
In this example the <literal>"a" =&gt; "green"</literal>

Would be better to rephrase the other wording to get rid of personalization.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right! I also took the opportunity to remove "you" occurrences in these pages.

Comment on lines 97 to 100
return ($a > $b)? 1:-1;

return ($a > $b) ? 1 : -1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use the spaceship operator, as this exists since 7.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you go 🙂

@Girgias Girgias merged commit 6b64170 into php:master Aug 7, 2023
2 checks passed
@alexandre-daubois alexandre-daubois deleted the array-diff-assoc-fix branch August 7, 2023 14:30
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

Successfully merging this pull request may close these issues.

Example #1 array_diff_assoc() example [second arrays last value should have a key "1"]
2 participants