Bug #11762: bad example
| From: | Xuefer at 21cn dot com | Date: | Thu, 28 Jun 2001 02:34:30 +0000 |
| Subject: | Bug #11762: bad example | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-58267@lists.php.net to get a copy of this message | ||
From: Xuefer@21cn.com
Operating system: win2k
PHP version: 4.0.5
PHP Bug Type: Documentation problem
Bug description: bad example
PHP manual
getdate
(PHP 3, PHP 4 )
getdate -- Get date/time information
Description
array getdate ([int timestamp])
............
Example 1. getdate() example
$today = getdate();
$month = $today[month];
$mday = $today[mday];
$year = $today[year];
echo "$month $mday, $year";
---
-> $mday = $today[mday];
warnning: Use of undefined constant mday - assumed 'mday'
although a undefined constant will be assumed as a string, it's still a bad usage of this auto
conversion.
php manual writers shouldn't make a bad guide for php learners
thx
--
Edit Bug report at: http://bugs.php.net/?id=11762&edit=1