In PHP 8.1 I am receiving the error below when using CActiveForm checkbox field, when the CFormModel model attribute has a default 'null' value as defined.
"strcmp(): Passing null to parameter #2 ($string2) of type string is deprecated"
The 'null' value is passed to the checkBoxList() method as the second argument variable $select. A null value is not allowed in PHP 8.1 in strcmp(). An additional condition check for !empty() on the $select variable will prevent this error, as well as support the remaining variable types for a string or array.
Q
A
Is bugfix?
✔️/❌
New feature?
✔️/❌
Breaks BC?
✔️/❌
Tests pass?
✔️/❌
Fixed issues
comma-separated list of tickets # fixed by the PR, if any
In PHP 8.1 I am receiving the error below when using CActiveForm checkbox field, when the CFormModel model attribute has a default 'null' value as defined.
"strcmp(): Passing null to parameter #2 ($string2) of type string is deprecated"
The 'null' value is passed to the checkBoxList() method as the second argument variable $select. A null value is not allowed in PHP 8.1 in strcmp(). An additional condition check for !empty() on the $select variable will prevent this error, as well as support the remaining variable types for a string or array.