Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-76409

PHP 8.2: ksort(..., SORT_REGULAR) sort order changes

XMLWordPrintable

      See the following for a good description: https://php.watch/versions/8.2/ksort-SORT_REGULAR-order-changes

      From 8.2, when the optional flags parameter is provided and set to SORT_REGULAR, change in behaviour means that alphabetical keys are sorted prior to numeric keys.

      Example: https://3v4l.org/UJhGr

      There are no explicit usages of SORT_REGULAR in the codebase, however there are many cases of ksort without explicit sorting methods, so SORT_REGULAR{{ applies by default. See attached text file.}}

      Each usage needs to be checked and case-by-case decide what is needs to be done.  This will be either:

      • Leave the code as is because the new sorting behaviour SORT_REGULAR doesn't make much difference to the functionality or is better than it was
      • Rewrite the behavior using uksort and an anonymous function to implement the old/previous/original ksort behavior

      For third party libraries we should:

      • IF they are: Pull them in ASAP
      • If they are not, is there a PR for them already?
      • If so, can we help get it over th eline?
      • If not, see if we can help do the work

            Unassigned Unassigned
            dobedobedoh Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.