-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 7.4 support #4797
Comments
Changes and deprecationsBesides new features, there are also lots of changes to the language. Most of these changes are non-breaking, though some might have an effect on your code bases. Note that deprecation warnings aren't per definition "breaking", but merely a notice to the developer that functionality will be removed or changed in the future. It would be good not to ignore deprecation warnings, and to fix them right away; as it will make the upgrade path for PHP 8.0 more easy. Left-associative ternary operator deprecation rfcThe ternary operator has some weird quirks in PHP. This RFC adds a deprecation warning for nested ternary statements. In PHP 8, this deprecation will be converted to a compile time error. 1 ? 2 : 3 ? 4 : 5; // deprecated
(1 ? 2 : 3) ? 4 : 5; // ok Exceptions allowed in __toString rfcPreviously, exceptions could not be thrown in This behaviour is now changed, and exceptions can be thrown from Concatenation precedence rfcIf you'd write something like this: echo "sum: " . $a + $b; PHP would previously interpret it like this: echo ("sum: " . $a) + $b; PHP 8 will make it so that it's interpreted like this: echo "sum :" . ($a + $b); PHP 7.4 adds a deprecation warning when encountering an unparenthesized expression containing a array_merge without arguments upgradingSince the addition of the spread operator, there might be cases where you'd want to use $merged = array_merge(...$arrayOfArrays); To support the edge case where Curly brackets for array and string access rfcIt was possible to access arrays and string offsets using curly brackets: $array{1};
$string{3}; This has been deprecated. Invalid array access notices rfcIf you were to use the array access syntax on, say, an integer; PHP would previously return null. As of PHP 7.4, a notice will be emitted. $i = 1;
$i[0]; // Notice proc_open improvements upgradingChanges were made to
|
I've suggested here that people should hold off on updating their October sites to PHP 7.4 for the moment. That being said, the errors are pretty much entirely deprecations, so if you want to set PHP to ignore deprecations, it's quite possible that everything will still work as is. This will also likely be resolved with the Laravel 6 upgrade too. |
@ayumi-cloud also feel free to submit PRs to fix the errors as you find them, if the fix doesn't break support for 7.0 to 7.3 it'll be merged (until l6 is done, then it just needs to support 7.2) |
@bennothommo @LukeTowers I think it's misleading calling it php7.4 it's more like php8.0-rc.0 I had over 130 different errors in the event log (it's not a simple fix) for october. I'm hoping that you guys will update October to Laravel 6 first as they have done some work to update to php7.4 see there pull request here: laravel/framework#29482 When that is done, I can start going through all the vendor files and checking for php7.4 issues. Then after that continue checking plugins etc. Either way, I think this is going to become a breaking change and also no support for php 7.0 - 7.3 with all these changes and more to come with php 7.4.x minor updates. |
Laravel 6 upgrade is taking forever, do you have an estimate? It's always recommended to be on the latest php version and this breaks october sites. |
@filipac No firm estimate yet - it was only started within the last couple of weeks. Your patience will be much appreciated. As stated above, you can likely use October just fine with PHP 7.4 if you set up your PHP instance to ignore deprecations. |
Automated code analysis toolsAutomated code compatibility testing helps to detect possible problems in your code. (Using PHPCompatibility requires you to first install PHP CodeSniffer globally and then configure PHPCompatibility as the code standard to use).
(Would be great if someone created a plugin for October) |
@filipac consider contributing to the bounty. I said I'd be able to prioritize working on it over client work when it gets to 2,400 USD. |
Update: 7.4 should be supported as of Build 461 (core October files) Some plugins still may require attention |
Cool, going to re-test October v461 with php7.4 any issues will post in this thread. (I won't mention any plugin issues here - will only focus on core related issues here). |
Forget my last report, the installer throws the exception, i already created a pull request |
combining assets doesn't work on build 462 and php 7.4.1 |
@p5ych0 Please create a new GitHub issue for that and provide a stacktrace. |
@bennothommo I'm unable to find the place where the issue is introduced. Somewhere in the kriswallsmith/assetic. Also there's no stack trace due to error handler which I wasn't able to find as well |
@p5ych0 Is there a screenshot of the issue, just to give us an idea of what is occurring? |
@LukeTowers I'll put a patch in for this and push it on it's own branch |
@jaxwilko you can push it to the main dev branch, I'm not going to have time to test it myself and I trust you'll get it right 😄 |
The fix for the combiner issue is here: octobercms/library@b056665 Seems unrelated to Assetic. Fortunately, wikimedia has picked up the package... but we can't quite use it yet. Notes are in the commit
|
@jaxwilko could you check into using the package @daftspunk mentions in his commit in Assetic 2.0? We'll have to bump the PHP requirement but I'm fine with that |
Confirmed the SCSS compiler still seems to be working with a basic test
Returns
|
Im still getting a error with PHP 7.4 when running the command Heres the stack trace:
Looks like they fixed it in the Wikimedia copy of Less.php with this commit wikimedia/less.php@9d1a0dc Do you want me to create a PR to add in this change? |
Going to write here some info: PHP Version Bcmath:
Core:
EXIF:
October CMS uses the GD Plugin: |
@LukeTowers The Assetic library you've linked seems to be using a different less package, its using this one https://github.com/leafo/lessphp and the issue is in this one https://github.com/oyejorge/less.php which has been taken over by https://github.com/wikimedia/less.php I believe copying wikimedia/less.php@9d1a0dc to https://github.com/octobercms/library/blob/master/src/Parse/Assetic/Less/lib/Less/Tree/Import.php#L216-L218 will solve the issue, or am I missing something? |
@caloggs sure, you can submit that PR for now. Assetic will be moving to use Wikipedia's one as a part of the L6 update so it's fine if we continue with the temporary monkey patch for now. |
@LukeTowers Thanks for clarifying, will submit both PRs later today |
Today, been running a few tests with php 7.4 and October cms, it seems like many plugins are not working, but digging deeper it seems to be October CMS side and not the plugins.
Please can people investigate further.
Some examples:
Example 1
Clear file cache plugin (13,056 installations) see github issue: alserom/octobercms_clearcachewidget#18
The Stack Trace is saying the code line: https://github.com/alserom/octobercms_clearcachewidget/blob/7c7642de198c50d7bd61a285c59658c5cb4d2e49/reportwidgets/ClearCache.php#L66
That is calling an artisan command, so it looks like the issue is from October's side and not the plugin.
Example 2
Google Analytics plugin (11,934 installations) see github issue: rainlab/googleanalytics-plugin#92
The issue says:
Having searched that plugin I can't find
implode()
being used by the plugin, but October is usingimplode()
.Example 3
Google Analytics Extension plugin (2,135 installations) see github issue: scottbedard/analyticsextension#9
The issue says:
Having searched that plugin I can't find
implode()
being used by the plugin, but October is usingimplode()
.Example 4
This time, not a plugin example. Instead Twig is saying issues in the Stack Trace:
See github issue: twigphp/Twig#3151
Example 5
PHP Deprecated Examples in October and plugins:
Conclusion
I'm seeing so many different errors from every direction when trying to use php 7.4 and October cms.
I would not recommend anyone try to use php 7.4 and October cms just yet.
Could the admins create an action plan or something to fully test everything with php 7.4
Thanks.
The text was updated successfully, but these errors were encountered: