Skip to content

Fix #4627: Replace deprecated is_integer() calls with is_int() for PHP 8.6 - #4627

Merged
samdark merged 2 commits into
yiisoft:masterfrom
ac-dc:codex/php86-is-integer
Sep 4, 2026
Merged

samdark merged 2 commits into
yiisoft:masterfrom
ac-dc:codex/php86-is-integer

Conversation

@ac-dc

@ac-dc ac-dc commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace all framework calls to is_integer() with the canonical is_int() alias.

Motivation

PHP 8.6 deprecates is_integer() and recommends is_int() instead.

RFC:
https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_is_integer

Tests

Relevant framework tests: 19 tests, 47 assertions.

@ac-dc ac-dc mentioned this pull request Aug 26, 2026
Comment thread CHANGELOG Outdated
Copilot AI lite review requested due to automatic review settings September 4, 2026 05:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are straightforward alias substitutions, and a repository-wide search shows no remaining is_integer( call sites outside the CHANGELOG note.

Pull request overview

This PR updates the Yii 1.1 framework codebase to avoid PHP 8.6 deprecation warnings by replacing deprecated is_integer() usage with the canonical alias is_int(), without changing runtime behavior.

Changes:

  • Replaced is_integer() with is_int() across framework code paths that branch on integer keys/values.
  • Updated yiilite.php (lite bundle) to keep it consistent with the source framework classes.
  • Added a CHANGELOG entry documenting the compatibility fix for PHP 8.6.
File summaries
File Description
framework/zii/widgets/CListView.php Uses is_int() when interpreting sorter attribute keys.
framework/yiilite.php Updates bundled/lite copies of the affected logic to is_int().
framework/web/helpers/CJavaScript.php Uses is_int() when encoding integer values to JS.
framework/db/schema/CDbCriteria.php Uses is_int() when merging scopes/with arrays by integer keys.
framework/db/ar/CActiveRecord.php Uses is_int() in attribute/scopes handling for integer-keyed arrays.
framework/collections/CMap.php Uses is_int() in recursive array merge logic for integer-keyed elements.
CHANGELOG Documents the deprecation replacement under 1.1.33 development.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@samdark samdark changed the title Replace deprecated is_integer() calls Fix #4627: Replace deprecated is_integer() calls with is_int() for PHP 8.6 Sep 4, 2026
@samdark
samdark merged commit d2c2d56 into yiisoft:master Sep 4, 2026
0 of 15 checks passed
@samdark

samdark commented Sep 4, 2026

Copy link
Copy Markdown
Member

👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants