[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-doc
Subject:    [PEAR-DOC] [PEAR-BUG] Bug #4648 [NEW]: DB_DataObject docs: bug in one of the examples
From:       "lists at norbert dot mocsnik dot hu" <pear-doc () lists ! php ! net>
Date:       2005-06-21 14:12:47
Message-ID: bug-4648 () pear ! php ! net
[Download RAW message or body]

From:             lists at norbert dot mocsnik dot hu
Operating system: irrelevant
PHP version:      Irrelevant
Package:          Documentation
Bug Type:         Bug
Bug description:  DB_DataObject docs: bug in one of the examples

Description:
------------
db-dataobject/intro-purpose.xml

line 112:
function getAge() {
    $age = date('Y') - date('Y',$this->birthDate);
}

The evaluated expression should be returned instead of putting it into a
local variable.

here is the corrected version:

function getAge() {
    return date('Y') - date('Y',$this->birthDate);
}



-- 
Edit bug report at http://pear.php.net/bugs/bug.php?id=4648&edit=1
-- 

-- 
PEAR Documentation List Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic