Question: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:
<?php
/* Function declaration here */
{
  $is_leap = (!($year %4) && (($year % 100) ||
  !($year % 400)));
  return $is_leap;
}
var_dump(is_leap(1987)); /* Displays false */
var_dump(is_leap()); /* Displays true */
?>
 

A function is_leap($year = 2000) 

B is_leap($year default 2000) 

C function is_leap($year default 2000) 

D function is_leap($year) 

E function is_leap(2000 = $year) 

+ Answer
+ Explanation
+ Report
Total Preview: 1064

Copyright © 2024. Powered by Intellect Software Ltd