Annotation of embedaddon/php/ext/date/tests/localtime_variation3.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test localtime() function : usage variation - Passing higher positive and negetive float values to timestamp.
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : array localtime([int timestamp [, bool associative_array]])
                      6:  * Description: Returns the results of the C system call localtime as an associative array 
                      7:  * if the associative_array argument is set to 1 other wise it is a regular array 
                      8:  * Source code: ext/date/php_date.c
                      9:  * Alias to functions: 
                     10:  */
                     11: 
                     12: echo "*** Testing localtime() : usage variation ***\n";
                     13: 
                     14: date_default_timezone_set("UTC");
                     15: // Initialise function arguments not being substituted (if any)
                     16: $is_associative = true;
                     17: 
                     18: echo "\n-- Testing localtime() function with 'float 12.3456789000e10' to timestamp --\n";
                     19: $timestamp = 12.3456789000e10;
                     20: var_dump( localtime($timestamp) );
                     21: var_dump( localtime($timestamp, $is_associative) );
                     22: 
                     23: echo "\n-- Testing localtime() function with 'float -12.3456789000e10' to timestamp --\n";
                     24: $timestamp = -12.3456789000e10;
                     25: var_dump( localtime($timestamp) );
                     26: var_dump( localtime($timestamp, $is_associative) );
                     27: 
                     28: ?>
                     29: ===DONE===
                     30: --EXPECTREGEX--
                     31: \*\*\* Testing localtime\(\) : usage variation \*\*\*
                     32: 
                     33: -- Testing localtime\(\) function with 'float 12.3456789000e10' to timestamp --
                     34: array\(9\) {
                     35:   \[0\]=>
                     36:   int\((16|0)\)
                     37:   \[1\]=>
                     38:   int\((50|30)\)
                     39:   \[2\]=>
                     40:   int\((4|0)\)
                     41:   \[3\]=>
                     42:   int\((26|11)\)
                     43:   \[4\]=>
                     44:   int\(2\)
                     45:   \[5\]=>
                     46:   int\((35|3982)\)
                     47:   \[6\]=>
                     48:   int\((2|6)\)
                     49:   \[7\]=>
                     50:   int\((84|69)\)
                     51:   \[8\]=>
                     52:   int\(0\)
                     53: }
                     54: array\(9\) {
                     55:   \["tm_sec"\]=>
                     56:   int\((16|0)\)
                     57:   \["tm_min"\]=>
                     58:   int\((50|30)\)
                     59:   \["tm_hour"\]=>
                     60:   int\((4|0)\)
                     61:   \["tm_mday"\]=>
                     62:   int\((26|11)\)
                     63:   \["tm_mon"\]=>
                     64:   int\(2\)
                     65:   \["tm_year"\]=>
                     66:   int\((35|3982)\)
                     67:   \["tm_wday"\]=>
                     68:   int\((2|6)\)
                     69:   \["tm_yday"\]=>
                     70:   int\((84|69)\)
                     71:   \["tm_isdst"\]=>
                     72:   int\(0\)
                     73: }
                     74: 
                     75: -- Testing localtime\(\) function with 'float -12.3456789000e10' to timestamp --
                     76: array\(9\) {
                     77:   \[0\]=>
                     78:   int\((44|52|0)\)
                     79:   \[1\]=>
                     80:   int\((9|45|30)\)
                     81:   \[2\]=>
                     82:   int\((19|20|23)\)
                     83:   \[3\]=>
                     84:   int\((8|13|22)\)
                     85:   \[4\]=>
                     86:   int\((9|11)\)
                     87:   \[5\]=>
                     88:   int\((104|1|-3843)\)
                     89:   \[6\]=>
                     90:   int\((5|-5)\)
                     91:   \[7\]=>
                     92:   int\((281|346|294)\)
                     93:   \[8\]=>
                     94:   int\(0\)
                     95: }
                     96: array\(9\) {
                     97:   \["tm_sec"\]=>
                     98:   int\((44|52|0)\)
                     99:   \["tm_min"\]=>
                    100:   int\((9|45|30)\)
                    101:   \["tm_hour"\]=>
                    102:   int\((19|20|23)\)
                    103:   \["tm_mday"\]=>
                    104:   int\((8|13|22)\)
                    105:   \["tm_mon"\]=>
                    106:   int\((9|11)\)
                    107:   \["tm_year"\]=>
                    108:   int\((104|1|-3843)\)
                    109:   \["tm_wday"\]=>
                    110:   int\((5|-5)\)
                    111:   \["tm_yday"\]=>
                    112:   int\((281|346|294)\)
                    113:   \["tm_isdst"\]=>
                    114:   int\(0\)
                    115: }
                    116: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>