基本参数问题

I just started learning PHP and I have some questions about the parameters. Consider DateTime class PHP DateTime Class Manual

public __construct ([ string $time = "now" [, DateTimeZone $timezone = NULL ]] )
public DateTime setDate ( int $year , int $month , int $day )

Here's my question:

  1. Why the parameters in the constructor are in brackets when setDate parameters aren't in brackets?
  2. Why there's bracket within a bracket?
  3. Why there's comma before the open bracket, [, ?

Thanks in advance.

  1. The parameters in brackets are optional. Therefore, if I initialize the DateTime class and don't provide the second parameter, it takes the default value of null.

  2. Nested brackets just means this: If I were to initialize the DateTime class, I provid either parameter 1 or parameter 1 and 2, or none at all. I cannot opt to provide no parameter 1, but a value for parameter 2.

  3. The comma just seperates the different parameters in the function's signature if more than 1 is provided..

  1. Parameters within square brackets are optional.
  2. Some optional parameters can only be specified if you specify other optional parameters.
  3. The comma is only required if you specify the second optional parameter.