PHP 8.0
I have mentioned this to a few developers privately, but time is running out and a plan needs to be made.
In a little over a month on the 23rd November PHP 8.0 will be released. This release follows the recent trend of PHP releases and turns several more Notices/Warnings into fatal errors. This breaks some core functionality of webERP.
For instance I noticed when looking at the GetPrice.php script for another thread, that while creating a sales order, searching for stock items throws the following:
Notice: Undefined variable: j in webERP-svn/SelectOrderItems.php on line 1768
Notice: Undefined variable: j in webERP-svn/SelectOrderItems.php on line 1769
Notice: Undefined variable: j in webERP-svn/SelectOrderItems.php on line 1772
Under PHP 8 this would cause the script to throw a fatal error and stop working. Unfortunately I know of no easy way to search for these issues, other than setting error_reporting() to -1 and adding the line ini_set('display_errors', 1); in config.php, and then working through all the functionality then noting down any Notices or Warnings issued. This is a lengthy job, but unless someone knows a better way it needs doing.
This "Undefined variable" issue is just one of quite a few breaking changes in PHP 8, it is just one that I happened to notice.
Tim
NB I have said for many years that except in production environments developers should always have error_reporting set to -1 and display_errors set to 1.
|