PHP 8.3 (Beta 3) Is Now Available for Testing on SiteGround Servers
Table of Contents
We are excited to announce that PHP 8.3 (Beta 3) is now available for testing on all SiteGround servers. Yet, again thanks to our unique multiple-PHP server setup, we are able to provide the latest PHP versions safely to anyone who wants to test them, almost immediately upon their official beta release. This means we are once again among the first companies to offer PHP 8.3 (Beta 3) for testing on our hosting platform 🎉🎉🎉.
Continue reading this blog post to discover more about the new features of the latest PHP version.
Let’s delve into some of the new features that PHP 8.3 Beta 3 brings to the table. This version may not be highlighted by sweeping changes or major upgrades, but it introduces a few key features that could significantly enhance the PHP development experience.
gc_status() Returns Additional GC Information
Long-running daemons and cron jobs have always been a weak part in PHP in general. However, with PHP 8.3, the gc_status() function now returns additional garbage collection (GC) information. This is a significant improvement for developers who need to manage memory usage in long-running scripts. More information about this feature can be found here.
class_alias() Supports Aliasing Built-in PHP Classes
Another exciting feature in PHP 8.3 is the ability to alias built-in PHP classes using the class_alias() function. This allows PHP developers to hook up into built-in classes and overwrite classes or declarations in them. This feature opens up a world of possibilities for extending and customizing the behavior of built-in PHP classes.
Another exciting addition in PHP 8.3 is the json_validate() function. This function validates if a string contains valid JSON, providing a more efficient alternative to userland implementations that use json_decode(). The json_decode() function generates a ZVAL (object/array/etc.) while parsing the string, using memory and processing that could be saved. The json_validate() function uses the same JSON parser that exists in the PHP core and is used by json_decode(), ensuring that what is valid in json_validate() is also valid in json_decode().
Changelog with all language and library changes in PHP 8.3 could be find at https://wiki.php.net/rfc#php_83
How to test PHP 8.3 (Beta 3) on SiteGround Servers
Now, with a one-button click in your SiteTools -> Devs section you’re able to replace the current PHP version used by your website with PHP 8.3 (Beta 3). It is important to emphasize on the fact that this is PHP 8.3 in its Beta 3 version. This means it is available for testing purposes mostly and as always we strongly advise you not to use it at your production site before the stable release date (November 23, 2023). If you want to test it with an existing site, set up a new site for testing, clone your production site into it, and play with that – our WordPress Staging tool is perfect for that purpose. When you are done, you can just delete it.
As you explore your new testing environment, check your log files after every test. Make sure nothing fails and see if any new warnings or errors pop up.
PHP 8.3 Beta 3 may not be marked by major upgrades, but it introduces a set of key features that could significantly enhance the PHP development experience – improvements to readonly classes, the new gc_status(), class_alias() and json_validate() functions, additions to the recently added Randomizer class, stack overflow detection, and more. That is not it for sure but there is enough time to “play” with the new PHP 8.3 (Beta 3) version and explore all sidekicks it might bring on before the official release.
Last but not least – remember, at SiteGround, we are committed to providing our clients with the latest and greatest in PHP technology well ahead of the others. Stay tuned for more updates and happy coding with PHP 8.3 (Beta 3)!