I just started learning PHP, and I have some questions about 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 is my question:
- Why are the parameters in the constructor in brackets when the parameters are
setDatenot in brackets? - Why is there a parenthesis inside the parenthesis?
- Why is there a comma before the open bracket
[,?
Thanks in advance.
source
share