diff options
| -rw-r--r-- | ext/date/tests/bug36988.phpt | 5 | ||||
| -rw-r--r-- | ext/date/tests/bug52062.phpt | 12 | ||||
| -rw-r--r-- | ext/date/tests/date_sunrise_variation2.phpt | 4 | ||||
| -rw-r--r-- | ext/date/tests/date_sunrise_variation9.phpt | 38 | ||||
| -rw-r--r-- | ext/date/tests/date_sunset_variation2.phpt | 6 | ||||
| -rw-r--r-- | ext/date/tests/date_sunset_variation9.phpt | 36 | ||||
| -rw-r--r-- | ext/date/tests/getdate_variation7.phpt | 63 | ||||
| -rw-r--r-- | ext/date/tests/gmdate_variation14.phpt | 16 | ||||
| -rw-r--r-- | ext/date/tests/gmstrftime_variation2.phpt | 8 | ||||
| -rw-r--r-- | ext/date/tests/idate_variation3.phpt | 18 | ||||
| -rw-r--r-- | ext/date/tests/localtime_variation3.phpt | 102 | ||||
| -rw-r--r-- | ext/date/tests/strftime_variation23.phpt | 18 |
12 files changed, 128 insertions, 198 deletions
diff --git a/ext/date/tests/bug36988.phpt b/ext/date/tests/bug36988.phpt index c37d1fb768..f82f3a1c52 100644 --- a/ext/date/tests/bug36988.phpt +++ b/ext/date/tests/bug36988.phpt @@ -5,7 +5,6 @@ Bug #36988 (mktime freezes on long numbers) date_default_timezone_set('GMT'); $start = microtime(true); $a = mktime(1, 1, 1, 1, 1, 11111111111); -echo (microtime(true) - $start) < 1 ? "smaller than one second" : "more than a second"; ?> ---EXPECT-- -smaller than one second +--EXPECTF-- +Warning: mktime() expects parameter 6 to be long, double given in %s on line %d diff --git a/ext/date/tests/bug52062.phpt b/ext/date/tests/bug52062.phpt index 81e767b0f0..9d35a2942f 100644 --- a/ext/date/tests/bug52062.phpt +++ b/ext/date/tests/bug52062.phpt @@ -2,7 +2,7 @@ Bug #52062 (large timestamps with DateTime::getTimestamp and DateTime::setTimestamp) (32 bit) --SKIPIF-- <?php -if (PHP_INT_SIZE == 8) die('skip 32-bit only'); +if (PHP_INT_SIZE != 4) die('skip 32-bit only'); ?> --INI-- date.timezone=UTC @@ -20,10 +20,12 @@ var_dump($d->getTimestamp()); $i = new DateInterval('PT100000000000S'); var_dump($i->format('%s')); ?> ---EXPECT-- +--EXPECTF-- string(32) "5138-11-16 09:46:40 100000000000" bool(false) string(12) "100000000000" -string(30) "2008-07-11 04:56:32 1215752192" -int(1215752192) -string(10) "1215752192" + +Warning: DateTime::setTimestamp() expects parameter 1 to be long, double given in %s on line %d +string(32) "5138-11-16 09:46:40 100000000000" +bool(false) +string(10) "1215752192"
\ No newline at end of file diff --git a/ext/date/tests/date_sunrise_variation2.phpt b/ext/date/tests/date_sunrise_variation2.phpt index b613b35f96..a6ae8824e2 100644 --- a/ext/date/tests/date_sunrise_variation2.phpt +++ b/ext/date/tests/date_sunrise_variation2.phpt @@ -114,12 +114,12 @@ bool(false) --float 12.3456789000e10-- -Warning: date_sunrise(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d +Warning: date_sunrise() expects parameter 2 to be long, double given in %s on line %d bool(false) --float -12.3456789000e10-- -Warning: date_sunrise(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d +Warning: date_sunrise() expects parameter 2 to be long, double given in %s on line %d bool(false) --float .5-- diff --git a/ext/date/tests/date_sunrise_variation9.phpt b/ext/date/tests/date_sunrise_variation9.phpt index 49af06d524..747ef67e66 100644 --- a/ext/date/tests/date_sunrise_variation9.phpt +++ b/ext/date/tests/date_sunrise_variation9.phpt @@ -32,16 +32,28 @@ var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $ze ?> ===DONE=== ---EXPECTREGEX-- -\*\*\* Testing date_sunrise\(\) : usage variation \*\*\* - --- Testing date_sunrise\(\) function by passing float 12.3456789000e10 value to time -- -string\(5\) "(07:34|07:49)" -float\((7.566[0-9]*|7.821[0-9]*)\) -int\((-1097256359|123456811756)\) - --- Testing date_sunrise\(\) function by passing float -12.3456789000e10 value to time -- -string\(5\) "(07:42|08:48|08:04)" -float\((7.713[0-9]*|8.810[0-9]*|8.074[0-9]*)\) -int\((1097304168|-2147443882|-123456761731)\) -===DONE=== +--EXPECTF-- +*** Testing date_sunrise() : usage variation *** + +-- Testing date_sunrise() function by passing float 12.3456789000e10 value to time -- + +Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +-- Testing date_sunrise() function by passing float -12.3456789000e10 value to time -- + +Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d +bool(false) +===DONE===
\ No newline at end of file diff --git a/ext/date/tests/date_sunset_variation2.phpt b/ext/date/tests/date_sunset_variation2.phpt index 575b64a22c..10d6d07f12 100644 --- a/ext/date/tests/date_sunset_variation2.phpt +++ b/ext/date/tests/date_sunset_variation2.phpt @@ -114,12 +114,12 @@ bool(false) --float 12.3456789000e10-- -Warning: date_sunset(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d +Warning: date_sunset() expects parameter 2 to be long, double given in %s on line %d bool(false) --float -12.3456789000e10-- -Warning: date_sunset(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d +Warning: date_sunset() expects parameter 2 to be long, double given in %s on line %d bool(false) --float .5-- @@ -208,4 +208,4 @@ int(1218199253) --unset var-- int(1218199253) -===DONE=== +===DONE===
\ No newline at end of file diff --git a/ext/date/tests/date_sunset_variation9.phpt b/ext/date/tests/date_sunset_variation9.phpt index 59a4b584a5..122e27b402 100644 --- a/ext/date/tests/date_sunset_variation9.phpt +++ b/ext/date/tests/date_sunset_variation9.phpt @@ -32,16 +32,28 @@ var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zen ?> ===DONE=== ---EXPECTREGEX-- -\*\*\* Testing date_sunset\(\) : usage variation \*\*\* - --- Testing date_sunset\(\) function by passing float 12.3456789000e10 value to time -- -string\(5\) "(19:49|19:28)" -float\((19.830[0-9]*|19.830[0-9]*|19.480[0-9]*)\) -int\((-1097212211|123456853728)\) - --- Testing date_sunset\(\) function by passing float -12.3456789000e10 value to time -- -string\(5\) "(19:03|18:12|18:48)" -float\((19.056[0-9]*|18.213[0-9]*|18.808[0-9]*)\) -int\((1097345002|-2147410031|-123456723090)\) +--EXPECTF-- +*** Testing date_sunset() : usage variation *** + +-- Testing date_sunset() function by passing float 12.3456789000e10 value to time -- + +Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +-- Testing date_sunset() function by passing float -12.3456789000e10 value to time -- + +Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d +bool(false) ===DONE=== diff --git a/ext/date/tests/getdate_variation7.phpt b/ext/date/tests/getdate_variation7.phpt index 5af2dd53fc..6af0c0288e 100644 --- a/ext/date/tests/getdate_variation7.phpt +++ b/ext/date/tests/getdate_variation7.phpt @@ -20,59 +20,16 @@ $timestamp = -12.3456789000e10; var_dump( getdate($timestamp) ); ?> ===DONE=== ---EXPECTREGEX-- +--EXPECTF-- +*** Testing getdate() : usage variation *** -\*\*\* Testing getdate\(\) : usage variation \*\*\* +-- Testing getdate() function by passing float 12.3456789000e10 value to timestamp -- --- Testing getdate\(\) function by passing float 12.3456789000e10 value to timestamp -- -array\(11\) { - \["seconds"\]=> - int\((36|0)\) - \["minutes"\]=> - int\((43|0)\) - \["hours"\]=> - int\((10|6)\) - \["mday"\]=> - int\((26|11)\) - \["wday"\]=> - int\((2|6)\) - \["mon"\]=> - int\(3\) - \["year"\]=> - int\((1935|5882)\) - \["yday"\]=> - int\((84|69)\) - \["weekday"\]=> - string\((7|8)\) "(Tuesday|Saturday)" - \["month"\]=> - string\(5\) "March" - \[0\]=> - int\((-1097262584|123456789000)\) -} +Warning: getdate() expects parameter 1 to be long, double given in %s on line %d +bool(false) --- Testing getdate\(\) function by passing float -12.3456789000e10 value to timestamp -- -array\(11\) { - \["seconds"\]=> - int\((44|12|20)\) - \["minutes"\]=> - int\((39|23)\) - \["hours"\]=> - int\((0|2|5)\) - \["mday"\]=> - int\((9|14|23)\) - \["wday"\]=> - int\((6|-4)\) - \["mon"\]=> - int\((10|12)\) - \["year"\]=> - int\((2004|1901|-1943)\) - \["yday"\]=> - int\((282|347|295)\) - \["weekday"\]=> - string\((8|7)\) "(Saturday|Unknown)" - \["month"\]=> - string\((7|8)\) "(October|December)" - \[0\]=> - int\((1097262584|-2147483648|-123456789000)\) -} -===DONE=== +-- Testing getdate() function by passing float -12.3456789000e10 value to timestamp -- + +Warning: getdate() expects parameter 1 to be long, double given in %s on line %d +bool(false) +===DONE===
\ No newline at end of file diff --git a/ext/date/tests/gmdate_variation14.phpt b/ext/date/tests/gmdate_variation14.phpt index 5b62a8274d..7269404802 100644 --- a/ext/date/tests/gmdate_variation14.phpt +++ b/ext/date/tests/gmdate_variation14.phpt @@ -23,12 +23,16 @@ var_dump( gmdate($format, $timestamp) ); ?> ===DONE=== ---EXPECTREGEX-- -\*\*\* Testing gmdate\(\) : usage variation \*\*\* +--EXPECTF-- +*** Testing gmdate() : usage variation *** --- Testing gmdate\(\) function with float 12.3456789000e10 to timestamp -- -string\((24|25)\) "(1935-03-26T04:50:16\+0000|5882-03-11T00:30:00\+0000)" +-- Testing gmdate() function with float 12.3456789000e10 to timestamp -- --- Testing gmdate\(\) function with float -12.3456789000e10 to timestamp -- -string\((24|25)\) "(2004-10-08T19:09:44\+0000|1901-12-13T20:45:52\+0000|-1943-10-22T23:30:00\+0000)" +Warning: gmdate() expects parameter 2 to be long, double given in %s on line %d +bool(false) + +-- Testing gmdate() function with float -12.3456789000e10 to timestamp -- + +Warning: gmdate() expects parameter 2 to be long, double given in %s on line %d +bool(false) ===DONE===
\ No newline at end of file diff --git a/ext/date/tests/gmstrftime_variation2.phpt b/ext/date/tests/gmstrftime_variation2.phpt index c577fe1d3d..c591dc3b16 100644 --- a/ext/date/tests/gmstrftime_variation2.phpt +++ b/ext/date/tests/gmstrftime_variation2.phpt @@ -112,10 +112,14 @@ string(20) "Jan 01 1970 00:00:10" string(20) "Dec 31 1969 23:59:50" --float 12.3456789000e10-- -string(20) "Mar 26 1935 04:50:16" + +Warning: gmstrftime() expects parameter 2 to be long, double given in %s on line %d +bool(false) --float -12.3456789000e10-- -string(20) "Oct 08 2004 19:09:44" + +Warning: gmstrftime() expects parameter 2 to be long, double given in %s on line %d +bool(false) --float .5-- string(20) "Jan 01 1970 00:00:00" diff --git a/ext/date/tests/idate_variation3.phpt b/ext/date/tests/idate_variation3.phpt index 1a2ee1ffd5..406f527f05 100644 --- a/ext/date/tests/idate_variation3.phpt +++ b/ext/date/tests/idate_variation3.phpt @@ -24,12 +24,16 @@ var_dump( idate($format, $timestamp) ); ?> ===DONE=== ---EXPECTREGEX-- -\*\*\* Testing idate\(\) : usage variation \*\*\* +--EXPECTF-- +*** Testing idate() : usage variation *** --- Testing idate\(\) function with float 12.3456789000e10 to timestamp -- -int\((1935|5882)\) +-- Testing idate() function with float 12.3456789000e10 to timestamp -- --- Testing idate\(\) function with float -12.3456789000e10 to timestamp -- -int\((2004|1901|-1943)\) -===DONE=== +Warning: idate() expects parameter 2 to be long, double given in %s on line %d +bool(false) + +-- Testing idate() function with float -12.3456789000e10 to timestamp -- + +Warning: idate() expects parameter 2 to be long, double given in %s on line %d +bool(false) +===DONE===
\ No newline at end of file diff --git a/ext/date/tests/localtime_variation3.phpt b/ext/date/tests/localtime_variation3.phpt index d941e3891e..97e09a6e0c 100644 --- a/ext/date/tests/localtime_variation3.phpt +++ b/ext/date/tests/localtime_variation3.phpt @@ -27,90 +27,22 @@ var_dump( localtime($timestamp, $is_associative) ); ?> ===DONE=== ---EXPECTREGEX-- -\*\*\* Testing localtime\(\) : usage variation \*\*\* +--EXPECTF-- +*** Testing localtime() : usage variation *** --- Testing localtime\(\) function with 'float 12.3456789000e10' to timestamp -- -array\(9\) { - \[0\]=> - int\((16|0)\) - \[1\]=> - int\((50|30)\) - \[2\]=> - int\((4|0)\) - \[3\]=> - int\((26|11)\) - \[4\]=> - int\(2\) - \[5\]=> - int\((35|3982)\) - \[6\]=> - int\((2|6)\) - \[7\]=> - int\((84|69)\) - \[8\]=> - int\(0\) -} -array\(9\) { - \["tm_sec"\]=> - int\((16|0)\) - \["tm_min"\]=> - int\((50|30)\) - \["tm_hour"\]=> - int\((4|0)\) - \["tm_mday"\]=> - int\((26|11)\) - \["tm_mon"\]=> - int\(2\) - \["tm_year"\]=> - int\((35|3982)\) - \["tm_wday"\]=> - int\((2|6)\) - \["tm_yday"\]=> - int\((84|69)\) - \["tm_isdst"\]=> - int\(0\) -} +-- Testing localtime() function with 'float 12.3456789000e10' to timestamp -- --- Testing localtime\(\) function with 'float -12.3456789000e10' to timestamp -- -array\(9\) { - \[0\]=> - int\((44|52|0)\) - \[1\]=> - int\((9|45|30)\) - \[2\]=> - int\((19|20|23)\) - \[3\]=> - int\((8|13|22)\) - \[4\]=> - int\((9|11)\) - \[5\]=> - int\((104|1|-3843)\) - \[6\]=> - int\((5|-5)\) - \[7\]=> - int\((281|346|294)\) - \[8\]=> - int\(0\) -} -array\(9\) { - \["tm_sec"\]=> - int\((44|52|0)\) - \["tm_min"\]=> - int\((9|45|30)\) - \["tm_hour"\]=> - int\((19|20|23)\) - \["tm_mday"\]=> - int\((8|13|22)\) - \["tm_mon"\]=> - int\((9|11)\) - \["tm_year"\]=> - int\((104|1|-3843)\) - \["tm_wday"\]=> - int\((5|-5)\) - \["tm_yday"\]=> - int\((281|346|294)\) - \["tm_isdst"\]=> - int\(0\) -} -===DONE=== +Warning: localtime() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +Warning: localtime() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +-- Testing localtime() function with 'float -12.3456789000e10' to timestamp -- + +Warning: localtime() expects parameter 1 to be long, double given in %s on line %d +bool(false) + +Warning: localtime() expects parameter 1 to be long, double given in %s on line %d +bool(false) +===DONE===
\ No newline at end of file diff --git a/ext/date/tests/strftime_variation23.phpt b/ext/date/tests/strftime_variation23.phpt index b7cf8d788e..4874a316b5 100644 --- a/ext/date/tests/strftime_variation23.phpt +++ b/ext/date/tests/strftime_variation23.phpt @@ -25,12 +25,16 @@ var_dump( strftime($format, $timestamp) ); ?> ===DONE=== ---EXPECTREGEX-- -\*\*\* Testing strftime\(\) : usage variation \*\*\* +--EXPECTF-- +*** Testing strftime() : usage variation *** --- Testing strftime\(\) function with float 12.3456789000e10 to timestamp -- -string\(\d*\)\s"Mar\s(26|11)\s(1935|5882)\s(04|00):(50|30):(16|00)" +-- Testing strftime() function with float 12.3456789000e10 to timestamp -- --- Testing strftime\(\) function with float -12.3456789000e10 to timestamp -- -string\(\d*\)\s"(Oct|Dec)\s(08|13|22)\s(2004|1901|-1943)\s(19|20|23):(09|45|30):(44|52|00)" -===DONE=== +Warning: strftime() expects parameter 2 to be long, double given in %s on line %d +bool(false) + +-- Testing strftime() function with float -12.3456789000e10 to timestamp -- + +Warning: strftime() expects parameter 2 to be long, double given in %s on line %d +bool(false) +===DONE===
\ No newline at end of file |
