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:
- Why the parameters in the constructor are in brackets when
setDate
parameters aren't in brackets? - Why there's bracket within a bracket?
- Why there's comma before the open bracket,
[,
?
Thanks in advance.