lessphp
lessphp copied to clipboard
Deprecated stuff under PHP 8.1
I just updated my local environment to PHP 8.1 and checked that there are several issues:
Deprecated: preg_match(): Passing null to parameter #4 ($flags) of type int is deprecated in /lessphp/lessc.inc.php on line 3608
Deprecated: Implicit conversion from float 19789.30078125 to int loses precision in /lessphp/lessc.inc.php on line 1672
Any plans on updating the existing code to support 8.1? Is there anybody who already forked the current code and updated it?
I forked the current code from https://github.com/mjphaynes/lessphp and updated it to run under PHP 8.1. You can install it via composer:
composer require ca-dsgn/lessphp
The code under packagist will also be auto-updated to support future releases of PHP.
This PR contains also a few others. The isset is not included there yet, maybe that PR can be updated too? https://github.com/leafo/lessphp/pull/657
Juste replace
if (preg_match($r, $this->buffer, $out, null, $this->count)) {
by
if (preg_match($r, $this->buffer, $out, PREG_UNMATCHED_AS_NULL, $this->count)) {