wakabayashi Posted Tuesday at 02:17 PM Posted Tuesday at 02:17 PM Spring is coming, which is always the time for me to make the big upgrades. I want to update my shop to bleeding edge again. In this process I wondered, if ThirtyBees does support PHP 8.4? Officially I can only read about PHP 8.3... Are there any expected/known issues with PHP 8.4?
0 nickz Posted Tuesday at 10:09 PM Posted Tuesday at 10:09 PM Do you module play along with your plan? Or don't you use any other?
0 datakick Posted Wednesday at 06:34 AM Posted Wednesday at 06:34 AM The core is not yet php8.4 ready. We already fixes few issues, but there are still some to iron out. There is nothing braking, though - just a lot of new deprecation warnings, mostly related to "Implicitly nullable parameter types". PHP8.4 now complains when parameter with default null value is not marked so. All methods and function that look like public function func(string $test = null) must now have slightly different signature: public function func(?string $test = null) It's fairy easy to fix these warnings. There are even an automated scripts to do that across entire codebase. But obviously, we can't fix third party modules. I'm also a little bit worried about method overrides. I'm not sure how well PHP will take if the overridden method has slightly different signature. 1
0 wakabayashi Posted Wednesday at 07:34 AM Author Posted Wednesday at 07:34 AM 9 hours ago, nickz said: Do you module play along with your plan? Or don't you use any other? I basically only use my own modules and a few core modules and a frew from datakick. So I am fine on this side. 57 minutes ago, datakick said: There is nothing braking, though - just a lot of new deprecation warnings, mostly related to "Implicitly nullable parameter types". Ok that sounds good for me. 😏👍
0 Yabber Posted Wednesday at 08:37 AM Posted Wednesday at 08:37 AM On github I saw that to smarty version 4.5.5 developer from prestashop added support for PHP 8.4 https://github.com/smarty-php/smarty/releases
0 datakick Posted Wednesday at 08:58 AM Posted Wednesday at 08:58 AM 1 minute ago, Yabber said: On github I saw that to smarty version 4.5.5 developer from prestashop added support for PHP 8.4 https://github.com/smarty-php/smarty/releases Unfortunately it won't be easy to upgrade smarty to newer versions easily. New versions of smarty raises a lot of new deprecation warnings when templates call php methods directly. We are now required to register all methods that are allowed to be called from smarty template. As you can imagine, that's something absolutely impossible for system like thirtybees/prestashop -- we simply don't have that information. For example, if some module template contains code like this: {if Configuration::get('PS_INVOICE')} <span>...</span> {/if} we would have to tell smarty engine that the method Configuration::get exists and can be called. In the near future, using that template without registering the method would cause runtime error. Because we are using templates from third party modules and themes, we simply don't know what methods are used. The only potential solution for us is to parse templates to collect list of all used methods so we could register them before template is used. While the parsing can be done only once (when template source changes), the registration of methods needs to be done on every render. That will cause quite a big performance impact - we need to load the info from somewhere and pass it to smarty engine. I don't understand why this change has been introduced, and I'm very unhappy about that. We will either have to keep using smarty 4.4.1 forever (which is not possible due to new php versions not supporting it). Or we will have to invest days or weeks of work to implement that stupid registration, just to get to the same point we are now.
0 wakabayashi Posted Wednesday at 01:56 PM Author Posted Wednesday at 01:56 PM 4 hours ago, datakick said: I don't understand why this change has been introduced, and I'm very unhappy about that. We will either have to keep using smarty 4.4.1 forever (which is not possible due to new php versions not supporting it). Or we will have to invest days or weeks of work to implement that stupid registration, just to get to the same point we are now. Yeah this sounds like a very stupid idea from smarty team. But now I am little confused about the php 8.4. Does it mean the smarty version of the core, doesn't work with it? Or are we also just talking about some deprecation warnings?
0 Yabber Posted Wednesday at 02:22 PM Posted Wednesday at 02:22 PM 24 minutes ago, wakabayashi said: But now I am little confused about the php 8.4. Does it mean the smarty version of the core, doesn't work with it? Or are we also just talking about some deprecation warnings? I installed Smarty v.4.5.5 on my thirtybees test version and enabled PHP 8.4 So far no critical error has occurred, but there are hundreds of deprecation warnings in the logs. But this solution adopted in Smarty actually heavily complicates the upgrade to PHP 8.4 1
0 musicmaster Posted 20 hours ago Posted 20 hours ago Here is the discussion on the Smarty Github: https://github.com/smarty-php/smarty/discussions/967
0 datakick Posted 19 hours ago Posted 19 hours ago 1 hour ago, musicmaster said: Here is the discussion on the Smarty Github: https://github.com/smarty-php/smarty/discussions/967 Thanks, interesting read. At least for smarty v5 there is a dirty fix available that will not require much work. That's good to know. Unfortunately this fix is not available for smarty 4.4.x, so we will have to skip those and update straight to smarty v5. And there are many breaking changes related to that update, so it won't be doing that anytime soon.
Question
wakabayashi
Spring is coming, which is always the time for me to make the big upgrades. I want to update my shop to bleeding edge again. In this process I wondered, if ThirtyBees does support PHP 8.4? Officially I can only read about PHP 8.3...
Are there any expected/known issues with PHP 8.4?
9 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now