-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP Fatal error: Uncaught Exception: E_NOTICE in PHP 7.4 #649
Comments
Same here. Also could provide help on fixing this. Please let me know whether this is appreciated. |
As the PHP docs state the return value of
|
Thank You . I have the error from LionThemes helper using a wordpress plugin but mine is on line 665. I have been pulling my hair out for the last week trying to figure this out. I have scoured the internet up and down all ways around and this comment and code you gave fixed it. My god why is this information so hard to find? |
It seems like PHP 7.4 is more strict when accessing an empty array. In 7.3 you'd simply get
NULL
, but now it also throws an exception.Problem is caused by this https://github.com/leafo/lessphp/blob/master/lessc.inc.php#L663-L665 part of code.
Simple reproduction is possible with
If you execute above code with PHP 7.3.12, nothing happens, while
7.4.0
throws and prints the error.You can reproduce it here: http://sandbox.onlinephpfunctions.com/
Now, because we're using
lessphp
in production and we're migration to PHP 7.4 I simply made this changewhich solves our specific issue. Not sure if this really is correct change though.
Do you run tests on php 7.4 too? Would you be interested in getting a PR which reproduces and fixes this issue?
The text was updated successfully, but these errors were encountered: