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

PHP. 8.3: Invariant constant visibility

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • 4.3.1, 4.4
    • General

      https://stitcher.io/blog/new-in-php-83#invariant-constant-visibility-breaking

      Previously, visibility for constants weren't checked when implementing an interface. PHP 8.3 fixes this bug, but it might lead to code breaking in some places if you weren't aware of this behaviour.

      interface I {
          public const FOO = 'foo';
      }
       
      class C implements I {
          private const FOO = 'foo';
      }
      

      Required

      I don't think we can do much to detect this statically. It will show up with unit tests and behat tests under PHP 8.3 pretty quickly.

      1. Confirm my assessment at the inability to detect this and close

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Raquel Ortega Raquel Ortega
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m

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