Maybe someone can help explain the strange behaviour with this anon object:
$equipTest = (object) [
$leakageLimit = "",
$description = "",
$location = "",
$text = "",
];
$description = "";
In the following loop, I can assign values to $leakageLimit
with no issues.
$equipTest->leakageLimit = $temp;
But $location
will not let me concatenate to it with out an error/notice:
$equipTest->location .= $temp;
Results in:
Notice (8): Undefined property:
stdClass::$location
As it did for $equipTest->description
until I declared a temp var outside the loop. I assigned values to the temp description in the loop with:
$description .= $temp;
And then assigned it to the object at the end of the loop with:
$equipTest->$description = $description;
Why can't I concatenate to this anonymous object? It was OK before when I had it as part of a fully declared class.