Repository navigation
Use is_int() in stats to fix PHP 8.6 deprecation - #3192
Open
faisalahammad wants to merge 1 commit into
Open
faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
This was referenced Nov 25, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Proposed in this Pull Request
PHP 8.6 deprecates the
is_integer()alias.Stats::parse_stats()uses it to check the stat count, so every logged stat (job view, search impression, apply click) writes this notice:Replaced it with
is_int(). It is the same function, so the behavior does not change.Added
test_log_stat_rejects_non_integer_countto check that a string or float count is still rejected and nothing is logged.Repro on PHP 8.6:
php -r 'is_integer(1);'prints the deprecation.Testing Instructions
WP_DEBUGandWP_DEBUG_LOGtotrue.wp-content/debug.log. Ontrunkyou see theis_integer() is deprecatedline.debug.log, and open a different job in a new private window.is_integer()line indebug.log, and the job view is still counted on the job dashboard.Automated:
phpunitpasses on PHP 8.2 (1258 tests, 3 Geocode tests skipped), and PHPCS is clean.Release Notes
is_integer()when logging stats.