Skip to content

Remove useless floatval() cast in history::getHistoryFromCalcul#3399

Open
Salvialf wants to merge 1 commit into
developfrom
fix/history-calcul-float-key
Open

Remove useless floatval() cast in history::getHistoryFromCalcul#3399
Salvialf wants to merge 1 commit into
developfrom
fix/history-calcul-float-key

Conversation

@Salvialf

Copy link
Copy Markdown
Contributor

Summary

strtotime() returns int|false. Wrapping it in floatval() converts the result to a float, but PHP silently truncates floats back to integers when used as array keys, making the cast a no-op with no effect on behavior.

Removing it makes the intent explicit: the key is a Unix timestamp (integer).

Changes

  • history.class.php: $datetime = floatval(strtotime(...))$datetime = strtotime(...)

@Salvialf Salvialf added the changelog-other Use to generate release notes label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-other Use to generate release notes Need review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants