RE: [PEAR-DEV] silinging warnings?

From: Date: Sat, 28 Jun 2003 10:25:28 +0000
Subject: RE: [PEAR-DEV] silinging warnings?
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17813@lists.php.net to get a copy of this message
> From: Martin Jansen [mailto:mj@php.net] > Sent: Saturday, June 28, 2003 12:18 PM > > On Sat Jun 28, 2003 at 12:0808PM +0200, Lukas Smith wrote: > > function unix2Mdbstamp($unix_timestamp) > > { > > return date('Y-m-d H:i:s', $unix_timestamp); > > } > > > > This can lead to odd results if the unix timestamp is less than 0. I > > want to keep the code as simple as possible, because people can move to > > the PEAR::Date if they need anything more fancy. > > Why don't you use PEAR::raiseError("The given timestamp has to be >= 0") > or similar? Well obviously I could do that. I know if that is a good solution for such a simple helper class. There is no need for fancy error handling here. Returning '' is quite fine I think. Regards, Lukas

« previous php.pear.dev (#17813) next »