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

ksort() behavior changed since PHP 8.2 #3307

Closed
mabar opened this issue Apr 7, 2024 · 1 comment
Closed

ksort() behavior changed since PHP 8.2 #3307

mabar opened this issue Apr 7, 2024 · 1 comment
Labels
bug Documentation contains incorrect information

Comments

@mabar
Copy link

mabar commented Apr 7, 2024

ksort() before PHP 8.2 sorted first string keys, then numeric keys. Since PHP 8.2 it sorts first numeric keys, then string keys.

I think this change should be noted in the ksort documentation and in the changelog.

I have tested these flags:

  • SORT_REGULAR, SORT_ASC, SORT_DESC - behavior changed
  • SORT_NATURAL - behavior is the same

I don't know if any other sorting functions are affected

See https://3v4l.org/T2EDs

@cmb69
Copy link
Member

cmb69 commented Jul 22, 2024

Indeed, so far this is only mentioned in the migration guide,

@cmb69 cmb69 added the bug Documentation contains incorrect information label Jul 22, 2024
@cmb69 cmb69 closed this as completed in 4acad9b Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Documentation contains incorrect information
Projects
None yet
Development

No branches or pull requests

2 participants