1--TEST-- 2Test getdate() function : usage variation - Passing octal timestamp values 3--FILE-- 4<?php 5echo "*** Testing getdate() : usage variation ***\n"; 6 7//Set the default time zone 8date_default_timezone_set("Asia/Calcutta"); 9 10//array of values to iterate over 11$inputs = array( 12 13 //octal values 14 'octal 05' => 05, 15 'octal 010' => 010, 16 'octal -010' => -010, 17); 18 19// loop through each element of the array for timestamp 20 21foreach($inputs as $key =>$value) { 22 echo "\n--$key--\n"; 23 var_dump( getdate($value) ); 24}; 25 26?> 27--EXPECT-- 28*** Testing getdate() : usage variation *** 29 30--octal 05-- 31array(11) { 32 ["seconds"]=> 33 int(5) 34 ["minutes"]=> 35 int(30) 36 ["hours"]=> 37 int(5) 38 ["mday"]=> 39 int(1) 40 ["wday"]=> 41 int(4) 42 ["mon"]=> 43 int(1) 44 ["year"]=> 45 int(1970) 46 ["yday"]=> 47 int(0) 48 ["weekday"]=> 49 string(8) "Thursday" 50 ["month"]=> 51 string(7) "January" 52 [0]=> 53 int(5) 54} 55 56--octal 010-- 57array(11) { 58 ["seconds"]=> 59 int(8) 60 ["minutes"]=> 61 int(30) 62 ["hours"]=> 63 int(5) 64 ["mday"]=> 65 int(1) 66 ["wday"]=> 67 int(4) 68 ["mon"]=> 69 int(1) 70 ["year"]=> 71 int(1970) 72 ["yday"]=> 73 int(0) 74 ["weekday"]=> 75 string(8) "Thursday" 76 ["month"]=> 77 string(7) "January" 78 [0]=> 79 int(8) 80} 81 82--octal -010-- 83array(11) { 84 ["seconds"]=> 85 int(52) 86 ["minutes"]=> 87 int(29) 88 ["hours"]=> 89 int(5) 90 ["mday"]=> 91 int(1) 92 ["wday"]=> 93 int(4) 94 ["mon"]=> 95 int(1) 96 ["year"]=> 97 int(1970) 98 ["yday"]=> 99 int(0) 100 ["weekday"]=> 101 string(8) "Thursday" 102 ["month"]=> 103 string(7) "January" 104 [0]=> 105 int(-8) 106} 107