Date: 08/29/02
- Next message: Marcus Börger: "[PHP-DOC] cvs: phpdoc /en/reference/image reference.xml"
- Previous message: spic <email protected>: "[PHP-DOC] #19148 [Opn]: Search for import in function List does not list import_request_variables"
- Next in thread: Cornelia Boenigk: "Re: [PHP-DOC] #19166 [NEW]: strtotime example in docs incorrect"
- Reply: Cornelia Boenigk: "Re: [PHP-DOC] #19166 [NEW]: strtotime example in docs incorrect"
- Reply: derick <email protected>: "[PHP-DOC] #19166 [Opn->Dup]: strtotime example in docs incorrect"
- Reply: jc <email protected>: "[PHP-DOC] #19166 [Dup]: strtotime example in docs incorrect"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: jc <email protected>
Operating system: Red Hat Linux 7.2
PHP version: 4.2.2
PHP Bug Type: Documentation problem
Bug description: strtotime example in docs incorrect
The docs for strtotime contain a code snippet that is supposed to catch
invalid dates. It fails in this example where $str is set to "1970-1-222"
and invalid date.
$str = "1970-1-222";
if (($timestamp = strtotime($str)) === -1) {
echo "The string ($str) is bogus";
}
else {
echo "$str == ". date('l dS of F Y h:i:s A',$timestamp);
}
The output is:
1970-1-222 == Monday 10th of August 1970 12:00:00 AM
Whereas is should say that 1970-1-222 is a bogus date.
Jc
-- Edit bug report at http://bugs.php.net/?id=19166&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19166&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19166&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19166&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19166&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19166&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19166&r=support Expected behavior: http://bugs.php.net/fix.php?id=19166&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19166&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19166&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19166&r=globals-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Marcus Börger: "[PHP-DOC] cvs: phpdoc /en/reference/image reference.xml"
- Previous message: spic <email protected>: "[PHP-DOC] #19148 [Opn]: Search for import in function List does not list import_request_variables"
- Next in thread: Cornelia Boenigk: "Re: [PHP-DOC] #19166 [NEW]: strtotime example in docs incorrect"
- Reply: Cornelia Boenigk: "Re: [PHP-DOC] #19166 [NEW]: strtotime example in docs incorrect"
- Reply: derick <email protected>: "[PHP-DOC] #19166 [Opn->Dup]: strtotime example in docs incorrect"
- Reply: jc <email protected>: "[PHP-DOC] #19166 [Dup]: strtotime example in docs incorrect"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

