1--TEST--
2Test idate() function : usage variation - Checking return of year(1 or 2 digits) format starting with zero and nonzero.
3--FILE--
4<?php
5/* Prototype  : int idate(string format [, int timestamp])
6 * Description: Format a local time/date as integer
7 * Source code: ext/date/php_date.c
8 * Alias to functions:
9 */
10
11echo "*** Testing idate() : usage variation ***\n";
12
13// Initialise function arguments not being substituted (if any)
14date_default_timezone_set("Asia/Calcutta");
15$format = 'y';
16
17echo "\n-- Testing idate() function for 2 digit year having no zero as starting number --\n";
18$timestamp = mktime(8, 8, 8, 8, 8, 1970);
19var_dump( idate($format, $timestamp) );
20
21echo "\n-- Testing idate() function for 2 digit year having zero as starting number --\n";
22$timestamp = mktime(8, 8, 8, 8, 8, 2001);
23var_dump( idate($format, $timestamp) );
24?>
25===DONE===
26--EXPECTF--
27*** Testing idate() : usage variation ***
28
29-- Testing idate() function for 2 digit year having no zero as starting number --
30int(70)
31
32-- Testing idate() function for 2 digit year having zero as starting number --
33int(1)
34===DONE===
35