What is the correct syntax for concatenating a variable with an object property in PHP?

When concatenating a variable with an object property in PHP, you need to use the concatenation operator (.) to combine the variable and object property. To access an object property within a string, you should enclose the object property in curly braces {} within the string. This allows PHP to correctly interpret the object property and concatenate it with the variable.

// Example of concatenating a variable with an object property in PHP
class MyClass {
    public $property = 'World';
}

$obj = new MyClass();
$variable = 'Hello';

// Concatenating variable with object property using curly braces
echo $variable . " {$obj->property}";