note 122315 deleted from language.operators.string by crell
| From: | crell@php.net | Date: | Mon, 04 Apr 2022 16:53:59 +0000 |
| Subject: | note 122315 deleted from language.operators.string by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218115@lists.php.net to get a copy of this message | ||
Note Submitter: lci at live dot ca
----
Note that the . operator accepts unquoted strings/undefined identifiers.
So $var = "test".test; will result in "testtest" being written to $var and not
an error (as one might expect).
Be careful when trying to concatenate variables with strings, if you miss the $ before the variable
name it will just concatenate the string with the variable name.
Example:
$variable1 = "testing";
$variable2 = "We are ".variable1;
$variable2 is now "We are variable1" as opposed to the intended "We are
testing".