Empty String¶
The empty string is '', "", <<<STRING
STRING (Heredoc syntax), or <<<'STRING'
STRING (Nowdoc syntax). Is it a string without any content.
The empty string is the neutral element for concatenation: concatenating an empty string to another string does not change the latter.
The empty string may be used as error report: for example, substr() returns an empty string when the offset is beyong the string range.
The empty string often serves as a default value, for properties and variables.
Comparisons between '' and other falsy values, such as 0 changed with PHP 8.0: it was true and became false.
The empty string is falsy: it is converted to the false boolean when implicit conversion is need, such as in a condition.
<?php
$emptyString = '';
?>
Related : String, Heredocs, Nowdocs, Falsy, file_put_contents(), str_contains(), zero