lessphp icon indicating copy to clipboard operation
lessphp copied to clipboard

Deprecated stuff under PHP 8.1

Open ca-dsgn opened this issue 2 years ago • 3 comments

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?

ca-dsgn avatar Aug 23 '22 07:08 ca-dsgn

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.

ca-dsgn avatar Aug 23 '22 08:08 ca-dsgn

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

Klap-in avatar Sep 01 '22 18:09 Klap-in

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)) {

labylo avatar May 31 '23 16:05 labylo