Workflow Automation: PHP Upgrade Changes
As we upgrade PHP version from 7.4 to 8.1 in Podio Workflow Automation, it is required to update your calculations to be PHP 8 compatible. Until we switch calculations to PHP 8.1, all calculations will be attempted on PHP 8.1 and will fall back to PHP 7.4 upon error so as to generate warnings but avoid disruption to any workflows.
To help with this change, we will now show all PHP notices, warnings, and errors in the flow editor, previews, and flow logs for all calculations. Please refer to the messages below for details on how to fix your calculation. Please check the detailed change list and update the flow as per PHP 8.1.
-
What did PHP change?
String to number comparison.
- Empty strings will no longer match 0.
- Comparing an empty string to 0 would before return True, but now returns False.
- 0 will no longer match a non-numeric string.
- Strings containing characters and numbers will no longer match an integer value.
No error message.
Example Problem:
Example 1:
0 == "";
// or
substr_count("the dog", "cat") == "";
PHP 7 calculations will return True.
PHP 8 calculations will return False.
Example Solution:
Example 1:
Always compare an integer return value to an integer.
substr_count("the dog", "cat") == 0; // True
Reference:
- Empty strings will no longer match 0.