Jump to content

PHP 8.1 vs. 8.2, PW 3.0.210 vs DEV


douglas81
 Share

Recommended Posts

Hi folks,

I'm looking for some general advice on where things stand with PHP 8.X and ProcessWire versions.

Having recently migrated to a new webhost, I now have the option of using any PHP version (from 5.3 right up to 8.2) and I'm trying to decide on which version to go for.

At the moment, things seem to point towards PHP 8.1, but I'd be happy to go for 8.2 if it has been confirmed as stable with the latest ProcessWire DEV (3.0.221). Most of the sites I develop run a few modules (including Formbuilder with custom Stripe payment actions).

So, in a nutshell, my question is this:

If you had the choice of a clean install, which version of PHP and ProcessWire would you choose?

Thanks in advance for the insight!

Douglas.

  • Like 3
Link to comment
Share on other sites

3 hours ago, douglas81 said:

If you had the choice of a clean install, which version of PHP and ProcessWire would you choose?

  1. Peace-of-Mind Setup: ProcessWire 3.0.210, PHP 7.4
  2. Future-Proof Setup: ProcessWire 3.0.210 (or latest stable), PHP 8.1
  3. All-In Setup: ProcessWire DEV (always latest), PHP 8.2

 

If it was my own project to play around with ProcessWire - 3rd option.
If it's a small client project that once it's built never sees an update again - 1st option.
If it's a long term project with lots of functionality, lots of content, nice budget - 2nd option.

  • Like 3
Link to comment
Share on other sites

@wbmnfktr this makes a lot of sense. In your experience, PHP 8.2 with the latest DEV is pretty reliable? Any stand-out features from the DEV which you couldn't live without?

@da² yes, I guess that's the thing I'm slightly concerned about, that I'll suddenly be faced with all these little niggly bugs. Even if easy fixes, when there are a few across multiple sites it could be a pain to debug.

 

  • Like 2
Link to comment
Share on other sites

I guess @wbmnfktr you know that, but I want to mention that PHP7.4 is end of life since 2022 and we have PHP8.1 since 2021, so while I agree on the basic concept of using newer versions for less critical projects and older ones for others I'd vote for using 8.1 for the "peace-of-mind" setup.

I know being up to date with the PHP version not the only thing that counts, but I think it's good to stay at least with the latest supported version and we should encourage everybody to do so. It's really not a big deal in my opinion and if someone finds an issue in a 3rd party module that does not work with PHP8 than it's for sure better to inform the module author about that or to provide a PR than to use an outdated version of PHP.

I'm on 8.1 with most of my projects and I've not had any issues for a long time. There has been a lot of deprecation warnings, but they have all been addressed and tracy debugger now also has nice color options for making those warnings/errors more comfortable for the eyes 🙂  

  • Like 4
Link to comment
Share on other sites

2 minutes ago, bernhard said:

I guess @wbmnfktr you know that, but I want to mention that PHP7.4 is end of life since 2022

I am totally aware of this. Yet, the combo of PW 3.0.210 and PHP 8.1 wouldn't be my first choice right now.
But... this will change with the upcoming new stable version of ProcessWire. That would be a totally different story.

 

1 hour ago, douglas81 said:

PHP 8.2 with the latest DEV is pretty reliable?

It is, still it's nothing I'd recommend right now as the foundation of a project.

Not because it's not working, but because I don't know if the person I recommend this to can handle a few warnings and issues once in a while or would then just trash talk about ProcessWire because of it. That's the main reason I never recommend any All-in setups.

To be totally clear: if I knew you or the person better - for example someone like @bernhard - I'd probably suggest using PW DEV on PHP 8.2 actually.

  • Like 1
Link to comment
Share on other sites

8 hours ago, wbmnfktr said:

Future-Proof Setup: ProcessWire 3.0.210 (or latest stable), PHP 8.1

I am still getting a deprecation warning with that combo.

Quote

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/wire/core/WireInput.php on line 371

I think it is caused by the cookie module MarkupCookieConsent passing an explicitly null param, but it should be caught by the cookie() method in WireInput. Easily fixed by changing line 371 to

if($key === null || !strlen($key)) return $this->cookieVars;

Worth a PR?

  • Like 1
Link to comment
Share on other sites

1 hour ago, MarkE said:

I am still getting a deprecation warning with that combo.

Future-Proof involves a bit of work on your side. Future proof just means, it could and will probably be a solid setup in the future, either with your knowledge or changes brought in, or by PW/Ryan/Module Devs.

See below, please.

7 hours ago, wbmnfktr said:

Not because it's not working, but because I don't know if the person I recommend this to can handle a few warnings and issues once in a while or would then just trash talk about ProcessWire because of it. That's the main reason I never recommend any All-in setups.

If you are not THAT into PW or PHP... future proof or all-in/DEV setups might not work for you.
You chose to use an experimental* setup of PW/PHP.

* some kind of non-official setup right now (2023-07-05)
The combo you chose is somewhat in-between everything right now. IMHO.
I had quite a lot of issues with that combo and therefore moved to my Peace-of-Mind of setup in most cases.

[Disclaimer] I AM NOT A PROGRAMMER, or even a DEV - since 2014
I just use and work with ProcessWire. And it works for me.
I know almost nothing about PHP, besides echo/foreach/if/else and similar. And some details about PHP in general.
I do concepts most of the time, sometimes frontends (nowadays), and in the majority SEO, Marketing, and such.

So... yes... you still get those issues for whatever reason in some setups.
That's why I mentioned my personal Peace-of-Mind setup above. (as it totally works for me without any issues - and I am not an example for anything in those regards)

 

1 hour ago, MarkE said:

I think it is caused by...

As @bernhardmentioned... contact that module dev and let them know there might be something wrong. A PR/issue report is probably the best way to communicate that, AFTER contacting that DEV directly in one way or another. PRs with a solution at hand... always a great way to contribute.

SO... even though you got errors/warnings ... you helped to find issues to make PW more FUTURE PROOF and maybe even DEV setups. That's awesome.

 

(as mentioned in some other thread, I can't find right now: PW and PHP are moving quite fast right now... issues are a thing, but the outcome will be worth it)

  • Like 3
Link to comment
Share on other sites

16 hours ago, wbmnfktr said:

Peace-of-Mind Setup: ProcessWire 3.0.210, PHP 7.4

Currently, the site I mostly work on is running ProcessWire 3.0.213 and PHP 8.0.x with 62 third party modules. I do not have a single issue which is worth mentioning, so I'd say this is certainly a "Peace-of-Mind Setup".

Note that around ProcessWire 3.0.214 and ProcessWire 3.0.215 Ryan has started some heavy refactoring in the core so I would not call current dev versions "Peace-of-Mind" even thought he has fixed a lot of newly introduced bugs since then.

  • Like 6
Link to comment
Share on other sites

13 hours ago, MarkE said:

I am still getting a deprecation warning with that combo.

A deprecation warning is nothing bad. It just tells you that the setup might cause problems in future versions of PHP but it's totally fine with the version that you are currently using. Not more, not less.

So I think having a recent version of PHP with some deprecation warnings is preferable to having an outdated version of PHP without any warnings.

  • Like 3
Link to comment
Share on other sites

Progress report:

I'm developing/maintaining all the sites in question, so decided to run the risk of latest DEV (3.0.222) and PHP 8.2 !

Only hiccups so far seem to be either a) namespace issues for an old site which I hadn't declared ProcessWire namespace stuff in the templates yet, and b) PHP 8.2 being less lenient (i.e. more strict!) about certains aspects of coding. For example, one of the older libraries I had installed was accidentally using curly braces to access array index - e.g. somearray{$foo}. And I had a few errors in my code here or there where for the OR conditional, I had only put a single vertical bar (which I guess earlier versions of PHP let slide 🙂

So, yeah - so far so good. Thanks for the input everyone. Will report back when fully migrated and let you all know how it goes.

  • Like 3
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...