I am reading a book about PHP and Object Oriented Design. I've found some code samples about the way the author uses the brackets that puzzles me a little. I let you a pair of samples below:
First sample:
print "Author: {$product->getProduct()};
Second sample:
$b = "{$this->title} ( {$this->producerMainName}, ";
$b .= "{$this->producerFirstName} )";
$b .= ": page count - {$this->nPages}";
All I know about print
construct, is that brackets around the arguments are not required (http://php.net/manual/en/function.print.php).
Furthermore, with specific reference to the second example, I'm asking myself why has the author decided to use even round brackets: wouldn't it be redundant? Is it just intended to improve legibility, or is there any other reasons I cannot imagine?