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

Using soft reserved words (numeric, enum) could break in the future

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.1.1, 4.2
    • None
    • General
    • None
    • MOODLE_401_STABLE, MOODLE_402_STABLE

    Description

      This was detected as part of MDL-73587 (PHPCompatibility complete run against codebase).

      • 'numeric' is a soft reserved keyword as of PHP version 7.0 and should not be used to name a class, interface or trait or as part of a namespace (namespace declaration)
      • 'enum' is a soft reserved keyword as of PHP version 8.1 and should not be used to name a class, interface or trait or as part of a namespace (namespace declaration)

      Note this is not critical and doesn't lead to any problem or PHP notice/warning/deprecation... just they are reserved and we should try to stop using them.

      Cases:

      • lib/php-enum/src/Enum.php : 7 & 22
      • mod/lesson/classes/local/numeric/helper.php : 26

      Ciao

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stronk7 Eloy Lafuente (stronk7)
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: