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

32 Bit PHP autoconverts analysable::MAX_TIME (9999999999) to float

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.9.9, 3.11.2, 4.0
    • None
    • Analytics
    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE

    Description

      https://github.com/moodle/moodle/blob/036800d99debfe61dde45f61292bc5ad44ab7cb0/analytics/classes/analysable.php#L41

      defines a constant that is used in the user.php analysable here:
      https://github.com/moodle/moodle/blob/036800d99debfe61dde45f61292bc5ad44ab7cb0/analytics/classes/user.php#L190-L192

      This again is used in the time splitting periodic class here
      https://github.com/moodle/moodle/blob/036800d99debfe61dde45f61292bc5ad44ab7cb0/analytics/classes/local/time_splitting/periodic.php#L82-L84

      DateTimeImmutable needs an int timestamp to work. 32 Bit PHP can't handle the integer value 9999999999, so it converts it to float. This leads to the warning:

      PHP Warning: DateTimeImmutable::setTimestamp() expects parameter 1 to be integer, float given in /moodle/application/htdocs/moodle/moodle_stacks/analytics/classes/local/time_splitting/periodic.php on line 83

      Possible solution: Smaller value for timestamp?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              poggenpohlda Daniel Poggenpohl
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: