Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP 8.0
10-09-2020, 10:48 PM,
#1
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.
Reply


Messages In This Thread
PHP 8.0 - by TimSchofield - 10-09-2020, 10:48 PM
RE: PHP 8.0 - by TurboPT - 10-11-2020, 03:05 AM
RE: PHP 8.0 - by TimSchofield - 10-11-2020, 07:35 AM
RE: PHP 8.0 - by TurboPT - 10-11-2020, 11:29 PM
RE: PHP 8.0 - by TurboPT - 10-12-2020, 01:39 AM
RE: PHP 8.0 - by TimSchofield - 10-12-2020, 07:10 AM
RE: PHP 8.0 - by TurboPT - 10-13-2020, 11:14 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)