Confirmed php 8.4+ compatibility - css can fail unexpectedly

Xon

Well-known member
Licensed customer
Affected version
2.3.9
I was recently updating a test site running on php 8.4.16, and some css pages started causing the following error:
Code:
Deprecated: Less_Functions::__construct(): Implicitly marking parameter $currentFileInfo as nullable is deprecated, the explicit nullable type must be used instead in .../src/vendor/oyejorge/less.php/lib/Less/Functions.php on line 12

It looks like the oyejorge/less.php library requires some patching:
Code:
class Less_Functions {

public $env;
public $currentFileInfo;

function __construct( $env, array $currentFileInfo = null ) {
$this->env = $env;
$this->currentFileInfo = $currentFileInfo;
    }

This should be ?array $currentFileInfo = null
 
Last edited:
I'v got 2 regex's which find hits;
Code:
\bfunction\b[^();]*\(([^),]*,)?\s*(?!mixed|null|\?)[\w\\]+(\s*\|\s*((?!null)[\w\\]+))*\s+(&\s*)?\$\w+\s*=\s*null\b

This one finds more false positives, but tends captures a few the above one doesn't;
Code:
function.*\([^\?\)]+\s*[\w]+\s*(&\s*)?\$[\w]+\s*=\s*null.*?\)
 
Well yeah, it's stopping us from upgrading php to 8.4 or 8.5
How so? It doesn't prevent anything from working. It's a deprecation notice. It doesn't break anything, it's merely a warning that some code may break in the future. And future is a long way off. It's stopping you from upgrading PHP to version 9.0, perhaps. But that's not something you need to worry about today as it hasn't even been announced yet.

Even more relevant is you won't even see the deprecation notice unless you're operating your forum with debug mode enabled. Which is not something you should be doing anyway.

So, no, it's not stopping you from doing anything.
 
How so? It doesn't prevent anything from working. It's a deprecation notice. It doesn't break anything, it's merely a warning that some code may break in the future. And future is a long way off. It's stopping you from upgrading PHP to version 9.0, perhaps. But that's not something you need to worry about today as it hasn't even been announced yet.

Even more relevant is you won't even see the deprecation notice unless you're operating your forum with debug mode enabled. Which is not something you should be doing anyway.

So, no, it's not stopping you from doing anything.

To be specific, my theme developer said...

Only major issue I see is CSS unexpectedly failing errors that's been reported:
https://xenforo.com/community/threads/php-8-4-compatibility-css-can-fail-unexpectedly.235756/
 
Okay well your theme developer is wrong and the two software developers who have replied to you are correct. You may do with that information whatever you wish.

For the reasons we have mentioned, this is not a high priority fix. It is more likely to be fixed in a future XenForo release such as 2.4 or 2.5 or higher or maybe even 3.0 depending on whether newer versions of Less.php fix or have already fixed their compatibility issue in a version that we can safely upgrade to.

Not entirely ruling out a fix in 2.3, I’m just setting the expectation. And it’s a reasonable conclusion because, as mentioned, nothing is actually broken so it’s up to you if you want to stay on an older PHP version when you don’t have to.
 
Okay well your theme developer is wrong and the two software developers who have replied to you are correct. You may do with that information whatever you wish.

For the reasons we have mentioned, this is not a high priority fix. It is more likely to be fixed in a future XenForo release such as 2.4 or 2.5 or higher or maybe even 3.0 depending on whether newer versions of Less.php fix or have already fixed their compatibility issue in a version that we can safely upgrade to.

Not entirely ruling out a fix in 2.3, I’m just setting the expectation. And it’s a reasonable conclusion because, as mentioned, nothing is actually broken so it’s up to you if you want to stay on an older PHP version when you don’t have to.
I'll relay your messages back to my programmer and theme developer and see what they say.

Thank you.
 
Back
Top Bottom