Skip to content

fix(Debug): treat zero time as valid timer start - #10569

Open
gr8man wants to merge 2 commits into
codeigniter4:developfrom
gr8man:fix/debug-timer-zero-time
Open

gr8man wants to merge 2 commits into
codeigniter4:developfrom
gr8man:fix/debug-timer-zero-time

Conversation

@gr8man

@gr8man gr8man commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Description
Timer::start() treated 0.0 as "no value" and silently replaced it with microtime(true). Changed to null coalescing (??) so only null falls back, preserving 0.0 as a valid timer start time.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@carson-codeigniter4 carson-codeigniter4 Bot added the bug Verified issues on the current code behavior or pull requests that will fix them label Sep 18, 2026

@paulbalandan paulbalandan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a changelog entry.

@gr8man
gr8man force-pushed the fix/debug-timer-zero-time branch from b18f1ba to 9ace171 Compare September 19, 2026 19:53
@gr8man
gr8man force-pushed the fix/debug-timer-zero-time branch from 9ace171 to dbbdba8 Compare September 19, 2026 19:54
- **I18n:** Fixed a bug where ``Time::today()``, ``Time::yesterday()``, and ``Time::tomorrow()`` ignored the specified ``$timezone`` and ``setTestNow()`` when calculating the day.
- **Logger:** Fixed a bug where interpolating a log message with array or non-stringable context values could raise PHP warnings or errors.
- **Cache:** Fixed ``MemcachedHandler::decrement()`` initializing a non-existent counter to the positive offset. Missing counters are now initialized to ``0``, reflecting Memcached's unsigned, saturating counter semantics.
- **Debug:** Fixed a bug where ``Timer::start()`` treated ``0.0`` as an empty value and substituted the current time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls put this alphabetically aligned to the top

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants