Ran into this error today which is confusing and seems broken. Can someone 
explain why this would throw an error and what the intended solution is? Thanks

htmlentities(): Passing null to parameter #1 ($string) of type string is 
deprecated: PHP 8.3

This code happens to be in a form building class so sometime $fieldValue is a 
string and other times it is null. Both are valid.

$fieldValue = null;

echo htmlentities($fieldValue ?? '’);

Thanks

----------------------------------
Daniel Baldwin
541-401-7797



Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to