php-src/ext/date/tests/bug41964.phpt
Derick Rethans 4b64dbb9a1 - MFH: Fixed bug #41964 (strtotime returns a timestamp for non-time string of
pattern '(A|a) .+').
- MFH: Fixed bug #41844 (Format returns incorrect number of digits for negative
  years -0001 to -0999).
- MFH: Fixed bug #41842 (Cannot create years < 0100 & negative years with
  date_create or new DateTime).
- MFH: Fixed bug #41709 (strtotime() does not handle 00.00.0000).
- MFH: Fixed bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as
  1999-11-30).
2007-07-12 18:58:00 +00:00

60 lines
923 B
PHP

--TEST--
Bug #41964 (strtotime returns a timestamp for non-time string of pattern '(A|a) .+')
--FILE--
<?php
date_default_timezone_set("UTC");
error_reporting(0);
$res = date_parse('Ask the Experts');
var_dump($res['zone'], $res['tz_abbr']);
echo "\n";
$res = date_parse('A ');
var_dump($res['zone'], $res['tz_abbr']);
echo "\n";
$res = date_parse('A');
var_dump($res['zone'], $res['tz_abbr']);
echo "\n";
$res = date_parse('a ');
var_dump($res['zone'], $res['tz_abbr']);
echo "\n";
$res = date_parse('a');
var_dump($res['zone'], $res['tz_abbr']);
echo "\n";
$res = date_parse('A Revolution in Development');
var_dump($res['zone'], $res['tz_abbr']);
echo "\n";
$res = date_parse('a nothing');
var_dump($res['zone'], $res['tz_abbr']);
echo "\n";
?>
--EXPECT--
NULL
NULL
int(-60)
string(1) "A"
int(-60)
string(1) "A"
int(-60)
string(1) "A"
int(-60)
string(1) "A"
int(-60)
string(1) "A"
int(-60)
string(1) "A"