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

Library function s() - implement change for PHP 5.4 described in comment

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2
    • Component/s: Libraries
    • Labels:

      Description

      In the s() function there is a comment saying that certain changes should be made to the function parameters to make it faster once Moodle requires PHP 5.4.

      Since Moodle does in fact require PHP 5.4 I suggest we make the changes and remove the comment. I've checked and it seems like these changes will result in a very small performance improvement; on a typical course page where there are 8,000 calls to s(), it will probably save about 2ms. So not measurable in normal use but hey we make the code shorter by removing that commment...

      There is a fairly decent unit test covering s(), which still passes after this change.

        Attachments

        1. MDL-55650.xlsx
          11 kB
        2. test.php
          2 kB

          Activity

            People

            • Assignee:
              quen Sam Marshall
              Reporter:
              quen Sam Marshall
              Peer reviewer:
              Tim Hunt
              Integrator:
              David Monllaó
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/16