1--TEST--
2Test date_sun_info() function : error variations
3--FILE--
4<?php
5/* Prototype  : array date_sun_info ( int $time , float $latitude , float $longitude   )
6 * Description:  Returns an array with information about sunset/sunrise and twilight begin/end.
7 * Source code: ext/standard/data/php_date.c
8 */
9
10echo "*** Testing date_sun_info() : usage variations ***\n";
11
12$time = "2006-12-12";
13$latitude=31.7667;
14$longitude=35.2333;
15
16echo "\n-- Testing date_sun_info() function with less than expected no. of arguments --\n";
17var_dump( date_sun_info() );
18var_dump( date_sun_info($time) );
19var_dump( date_sun_info($time, $latitude) );
20
21
22echo "\n-- Testing date_sun_info() function with more than expected no. of arguments --\n";
23$extra_arg = 99;
24var_dump( date_create($time, $latitude, $longitude, $extra_arg) );
25
26?>
27===Done===
28--EXPECTF--
29*** Testing date_sun_info() : usage variations ***
30
31-- Testing date_sun_info() function with less than expected no. of arguments --
32
33Warning: date_sun_info() expects exactly 3 parameters, 0 given in %s on line %d
34bool(false)
35
36Warning: date_sun_info() expects exactly 3 parameters, 1 given in %s on line %d
37bool(false)
38
39Warning: date_sun_info() expects exactly 3 parameters, 2 given in %s on line %d
40bool(false)
41
42-- Testing date_sun_info() function with more than expected no. of arguments --
43
44Warning: date_create() expects at most 2 parameters, 4 given in %s on line %d
45bool(false)
46===Done===
47