Multiple choice php

Choose the appropriate function declaration for the user-defined function is_leap(). Assume that, if not otherwise defined, the is_leap function uses the year 2000 as a default value:

{
$is_leap = (!($year %4) && (($year % 100) ||
!($year % 400)));
return $is_leap;
}

var_dump(is_leap(1987)); /* Displays false / var_dump(is_leap()); / Displays true */

  1. function is_leap($year = 2000)
  2. function is_leap($year default 2000)
  3. function is_leap($year)
  4. is_leap($year default 2000)
Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In PHP, default parameter values are defined using the assignment operator '=' within the function signature. 'function is_leap($year = 2000)' correctly sets the default value to 2000 if no argument is passed, satisfying the requirement for is_leap() to return true (for the year 2000).