Skip to content

PHP 8.4 compatibility: declare properties, fix deprecations - #1

Merged
shipcloudsebastiaan merged 3 commits into
masterfrom
php-8.4-compat
Oct 13, 2026
Merged

shipcloudsebastiaan merged 3 commits into
masterfrom
php-8.4-compat

Conversation

@shipcloudsebastiaan

Copy link
Copy Markdown
  • declare dynamic properties on lessc, lessc_parser and lessc_formatter_classic
  • replace ${var} interpolation with {$var}
  • pass 0 instead of null as preg_match() flags
  • cast float to int before modulo in color parsing

- declare dynamic properties on lessc, lessc_parser and lessc_formatter_classic
- replace ${var} interpolation with {$var}
- pass 0 instead of null as preg_match() flags
- cast float to int before modulo in color parsing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 14:18

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.

🟡 Changes recommended

Two remaining assignments can still create deprecated dynamic properties.

2 open findings
What changed in this PR

Updates lessphp for PHP 8.4 compatibility by removing several deprecated behaviors.

Changes:

  • Declares runtime state properties.
  • Updates interpolation and preg_match() flags.
  • Prevents implicit float-to-int conversion during color parsing.
File Description
lessc.inc.php Addresses property, interpolation, regex, and modulo deprecations.
lessify.inc.php Uses integer flags for preg_match().

🧠 Review effort: Balanced


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

Comment thread lessc.inc.php Resolved
Comment thread lessc.inc.php Resolved
…ecations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 14:26

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.

🟡 Changes recommended

Fatal PHP 8 syntax and additional float-modulo deprecations remain unresolved.

1 open finding
2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Handle fractional operands at all modulo operations

lessc.inc.php:1683

This cast only removes the float-to-int deprecation from raw-color parsing. Fractional LESS operands still reach PHP's integer-only % operator in lib_mod() (line 908) and op_number_number() (line 1892), so inputs such as mod(5.5, 2) or 5.5 % 2 continue to emit the same deprecation on PHP 8.4. Explicitly preserve the intended integer conversion at all such modulo sites (or use fmod() if fractional modulo is intended).

🧠 Review effort: Balanced

Comment thread lessify.inc.php Resolved
…signature)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 14:34

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 localized, complete, and preserve existing behavior while resolving the targeted deprecations.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@shipcloudsebastiaan
shipcloudsebastiaan merged commit a26af80 into master Oct 13, 2026
1 check passed
@shipcloudsebastiaan
shipcloudsebastiaan deleted the php-8.4-compat branch October 13, 2026 14:40
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.

2 participants