What are common mistakes when concatenating parameters in PHP constructors?

Common mistakes when concatenating parameters in PHP constructors include not properly separating the concatenated parameters with a dot (.) and not enclosing the entire concatenation in parentheses. To solve this issue, make sure to use the dot operator to concatenate the parameters and enclose the entire concatenation in parentheses to ensure correct order of operations.

class Example {
    private $message;

    public function __construct($param1, $param2) {
        $this->message = '(' . $param1 . ' ' . $param2 . ')';
    }

    public function getMessage() {
        return $this->message;
    }
}

$example = new Example("Hello", "World");
echo $example->getMessage(); // Output: (Hello World)