PHP 7.4.0 is already available

Does anyone know what changes in PHP7.4 would make xf1.5 incompatible with it?

Some of the deprecations in PHP 7.4 include:
  • Short open tags are to be removed.
  • The left-associative ternary operator will likely be removed, which means you’ll have to use explicit parentheses instead.
  • Curly brace syntax are no longer used, only square brackets.
  • Change the Precedence of the Concatenation Operator
Considering that around 60% of xenforo websites still seem to be on XF1, and quite a few of those seem to be currently stuck there, it would be nice to find a solution to the PHP7.4 upgrade for xf1.

They can still choose not to use php 7.4. Even in my shared hosting I can choose php version for every single domain.
 
Yes indeed. But there is benefit with using PHP7.4 if taking advantage of the significantly improved performance. (Speed/Preloading)
Check @eva2000 's benchmarks for Centminmod:
That's quite an amazing improvement.
 
I see this situation similar to the situation we were in with vbulletin3 ten years ago, when vb4 was not a viable upgrade solution yet. I ran vbulletin 3 until 2017. While the old forum version is no longer supported(EOL), the new version is unfortunately not an possibility yet. Therefore we need to see if the EOL forum version (XF1) can be edited to support current version(s) of PHP, MySQL and whatever server software we need to keep up to date.

We did it back then with vb3, so hopefully it can be done with xf1 as well.
 
Considering that around 60% of xenforo websites still seem to be on XF1, and quite a few of those seem to be currently stuck there, it would be nice to find a solution to the PHP7.4 upgrade for xf1.
Those figures would be disproportionately out of touch with our own understanding. Also it's 48.5%, not 60%.

We didn't actually have to make many changes to XF 2.1, and the issue we did resolve may in fact have been specific to XF 2.x so it may work.

But please stop trying to assert your situation as being the common situation. XF 2.1 is a viable upgrade so comparisons to VB3=>VB4 are unfair, at best.

Clearly there are more people who have upgraded to 2.x than haven’t and this number is growing daily.
 
Scan against XenForo 1.5.24, only listing PHP 7.4 specific reports that may (or may not) cause problems
Code:
FILE: library/XenForo/Helper/Hash.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
23 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $file{0}
---------------------------------------------------------------------------------------------------------------------------------------

FILE: library/XenForo/Application.php
----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------
  185 | WARNING | Function get_magic_quotes_gpc() is deprecated since PHP 7.4
  192 | WARNING | Function get_magic_quotes_runtime() is deprecated since PHP 7.4
----------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: library/Lgpl/utf8.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------
  47 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $str{$i}
  48 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $str{$i}
586 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $str{$i}
----------------------------------------------------------------------------------------------------------------------------------------

FILE: library/Zend/Json/Encoder.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------------------------
557 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $utf8{0}
558 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $utf8{0}
559 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $utf8{1}
564 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $utf8{0}
565 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $utf8{1}
566 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $utf8{1}
567 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $utf8{2}
----------------------------------------------------------------------------------------------------------------------------------------

FILE: library/Zend/Json/Decoder.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 6 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
324 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $str{$i}
351 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $str{$i}
358 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $str{$i}
431 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $str{$i}
494 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $chrs{$i}
552 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $utf16{0}
552 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $utf16{1}
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: library/Zend/Loader/PluginLoader.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------
131 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $prefix{$last}
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: library/Zend/Wildfire/Plugin/FirePhp.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------
733 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $name{0}
----------------------------------------------------------------------------------------------------------------------------------------

FILE: library/Zend/Filter/Compress/Zip.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------
240 | WARNING | [x] Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: $currName{0}
--------------------------------------------------------------------------------------------------------------------------------------------
 
I think some of those things, especially in the XF specific code, will be problematic unless you suppress warnings.

But, to be absolutely frank 🤷‍♂️

It's time to upgrade to XF 2.1 or stay on XF 1.5 with PHP 7.3 and we'd very much encourage the former given that XF 1.5 is already no longer receiving support, and support for security issues ends at the end of this month.
 
Those figures would be disproportionately out of touch with our own understanding.
Could you expand on this?
Also it's 48.5%, not 60%.
You are correct. I misread it. Thanks for correcting.
But please stop trying to assert your situation as being the common situation.
I don't know how common my situation is, but I do know that it's extremely common amongst the many admins I speak to.
XF 2.1 is a viable upgrade so comparisons to VB3=>VB4 are unfair, at best.
There is a lot of difference, with the most important one that XF actually offers a much better version to upgrade to which was not the case with vb4. But I also see a comparison as far as being stuck on a EOL version that is still used by a large number of websites.
Clearly there are more people who have upgraded to 2.x than haven’t and this number is growing daily.
I am sure that you are correct and that's positive. There is a strong trend visible on the cookie search engine that points towards good XF2 adoption. And if your figures are better than that's even more positive.
But I hope that the XF team also has an eye out for those admins that are not able to upgrade to XF2.
 
@Chris D Yeah not expecting XF 1.5 to get backwards PHP 7.4 support.

Though @Alfa1 if you're using Centmin Mod's PHP 7.3, it can potentially be as fast as other non-Centmin Mod folks regular PHP 7.4 binaries already when you enable Profile Guided Optimizations see benchmarks at PHP 7.3 + Profile Guided Optimizations can be as fast as PHP 7.4 & PHP 7.4 + PGO can be as fast as PHP 8.0 https://community.centminmod.com/posts/79730/. But really would need for specific Xenforo Profile Guided Optimization training to speed it up. Posted a thread to see if anyone can help with that to train PHP 7+ with Xenforo specific optimized code paths at https://xenforo.com/community/threa...foro-php-performance-via-pgo-training.156939/

Example below is Remi YUM based PHP 7.4.0 is ~28.5% slower than Centmin Mod PHP 7.4.0 + PGO enabled optimizations and ~17.7% slower than Centmin Mod 7.312 + PGO enabled optimizations and this is without Xenforo specific PGO training.

compare-detailed-benchmark-phpbenchmarks-01.png
 
There is a lot of difference, with the most important one that XF actually offers a much better version to upgrade to which was not the case with vb4. But I also see a comparison as far as being stuck on a EOL version that is still used by a large number of websites.

Yes there are a lot of differences, but upgrading XF 1.5 to 2.1 is a walk in the park compared to VB3 to VB4 (I've been there).
 
I tried PHP 7.4.0 on my test XF 2.1.5a forum which has XF full page guest caching enabled via redis caching and after a few page loads of index page, I get broken style with the following at the top in xf debug mode

1575313467205.png

quick editor seems broken too even with XF full page guest cache disabled

1575315109437.webp
 
Last edited:
There's a good amount of changes required for XF1 to be compatible with 7.4.0, although nothing that can't be overcome. I have XF 1.4, 1.5 and 2.1 sites all running on PHP 7.4.0 now.

If they were vanilla XF sites, I'd upgrade them... but too much work to rebuild all the custom stuff in 2.1, so the easier route is to make the old versions compatible.

Side note - I do think putting out XF1 versions with nothing added other than PHP 7.4 compatibility wouldn't be a bad use of time for XF dev. I suspect I'm not the only one in the boat where it's impossible to migrate to XF2 (although I'd love to). A day or two of work in return for a whole lot of license renewals to get the PHP compatible 7.4 version (I'd definitely be a few of them).

That being said, I do love XF2... and I've been using it for new applications, but I have a whole lot of XF1 code that isn't going to recode itself unfortunately. :)

One of these days I need to get ES updated. lol

1575338556188.webp
 
Has anyone got a plugin/patch to make XF1 sites PHP7.4 compatible?
At this point it’s probably best to start planning an upgrade path, you’re just going to have to do it eventually anyways.

With v1 EOL you aren’t going to see any support unless someone in the community releases a support patch - Your best course is to stick with what works, and plan an upgrade for better performance over time.
 
Top Bottom