[PHP] changing NULL behavior in PHP arithmetic

2010-04-15 Thread cr.vegelin
Hi All, Is there an option in PHP to change the behavior of NULL in PHP functions ? Now PHP uses NULL as a 0 (zero) for arithmetic, for example: NULL + 6 = 6 NULL * 6 = 0 NULL / 6 = 0 6 / NULL = Division by zero What I need is the same behavior as #N/A (or =NA()) in Excel, where: #N/A + 6 = #N/A

Re: [PHP] changing NULL behavior in PHP arithmetic

2010-04-15 Thread Ashley Sheridan
On Thu, 2010-04-15 at 09:46 +0200, cr.vege...@gmail.com wrote: > Hi All, > > Is there an option in PHP to change the behavior of NULL in PHP functions ? > Now PHP uses NULL as a 0 (zero) for arithmetic, for example: > NULL + 6 = 6 > NULL * 6 = 0 > NULL / 6 = 0 > 6 / NULL = Division by zero > > W

Re: [PHP] Re: how to overload accessible methods

2010-04-15 Thread Richard Quadling
On 13 April 2010 17:25, Ryan Sun wrote: > this is a class for corntab job, and the validation is very simple, > just check if the status of user is active when cron job runs, if not, > throws an exception, other developers won't want to overwrite this > validation. > which method of user class wil

Re: [PHP] changing NULL behavior in PHP arithmetic

2010-04-15 Thread kranthi
>> because arithmetic operations with "Unknown" operands should result to >> "Unknown" ... in PHP "Unknown" values are represented by NaN, not NULL http://php.net/manual/en/function.is-nan.php but what surprises me is is_nan(6/0) = (bool)false (along with a warning) >> Now PHP uses NULL as a 0 (

Re: [PHP] changing NULL behavior in PHP arithmetic

2010-04-15 Thread cr.vegelin
From: Ashley Sheridan To: cr.vege...@gmail.com Cc: php-general@lists.php.net Sent: Thursday, April 15, 2010 10:08 AM Subject: Re: [PHP] changing NULL behavior in PHP arithmetic On Thu, 2010-04-15 at 09:46 +0200, cr.vege...@gmail.com wrote: Hi All, Is there an option in PHP to cha

Re: [PHP] Basic switch statement

2010-04-15 Thread tedd
At 4:13 PM -0400 4/14/10, Al wrote: Incidentally, about formatting scripts, one of the reasons I like phpEdit is that it has a terrific code beautifier. You can set it for phpDoc or Pear rendering. And, it auto indents, etc. as you enter stuff. Al... Unfortunately, there is no phpE

Re: [PHP] Basic switch statement

2010-04-15 Thread Bastien Koert
On Thu, Apr 15, 2010 at 8:55 AM, tedd wrote: > At 4:13 PM -0400 4/14/10, Al wrote: >> >> Incidentally, about formatting scripts, one of the reasons I like phpEdit >> is that it has a terrific code beautifier.  You can set it for phpDoc or >> Pear rendering. And, it auto indents, etc. as you enter

Re: [PHP] Basic switch statement

2010-04-15 Thread Ashley Sheridan
On Thu, 2010-04-15 at 08:55 -0400, tedd wrote: > At 4:13 PM -0400 4/14/10, Al wrote: > >Incidentally, about formatting scripts, one of the reasons I like > >phpEdit is that it has a terrific code beautifier. You can set it > >for phpDoc or Pear rendering. And, it auto indents, etc. as you > >e

[PHP] class attributes and __construct

2010-04-15 Thread Ashley Sheridan
I think this is probably going to end up as one of those coders' preference type of things, but I was wondering what was considered the general best approach. When creating a class, you can define default values for the object in the class itself, and within the __construct function. Now, while I

RE: [PHP] class attributes and __construct

2010-04-15 Thread Tommy Pham
Hi Ashley, > -Original Message- > From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] > Sent: Thursday, April 15, 2010 6:38 AM > To: PHP General List > Subject: [PHP] class attributes and __construct > > I think this is probably going to end up as one of those coders' > preference ty

RE: [PHP] class attributes and __construct

2010-04-15 Thread Ashley Sheridan
On Thu, 2010-04-15 at 07:42 -0700, Tommy Pham wrote: > Hi Ashley, > > > -Original Message- > > From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] > > Sent: Thursday, April 15, 2010 6:38 AM > > To: PHP General List > > Subject: [PHP] class attributes and __construct > > > > I think

Re: [PHP] class attributes and __construct

2010-04-15 Thread Fernando
Hello Ashely, I would initialize the variable when I'm defining it as there isn't much of a point of doing it in the constructor unless I'm having the value changed by a parameter. In my opinion: class House { public $roof = true; } is the way to go. Fernando. On 15/04/2010 11:54, Ash

RE: [PHP] class attributes and __construct

2010-04-15 Thread Tommy Pham
> -Original Message- > From: Fernando [mailto:ferna...@ggtours.ca] > Sent: Thursday, April 15, 2010 10:24 AM > To: php-general@lists.php.net > Subject: Re: [PHP] class attributes and __construct > > Hello Ashely, > > I would initialize the variable when I'm defining it as there isn't > mu

[PHP] Zip Search

2010-04-15 Thread Jack
Hello All, Can anyone recommend a good open source zip code search application and database? Thanks, Jack

Re: [PHP] Zip Search

2010-04-15 Thread Nathan Nobbe
On Thu, Apr 15, 2010 at 1:21 PM, Jack wrote: > Hello All, > > Can anyone recommend a good open source zip code search application and > database? > depends on what you want, u.s., canada & mexico are pretty easy to find but for other non domestic countries if you find something good feel free to

RE: [PHP] Zip Search

2010-04-15 Thread Tommy Pham
> -Original Message- > From: Nathan Nobbe [mailto:quickshif...@gmail.com] > Sent: Thursday, April 15, 2010 12:41 PM > To: Jack > Cc: php-general@lists.php.net > Subject: Re: [PHP] Zip Search > > On Thu, Apr 15, 2010 at 1:21 PM, Jack wrote: > > > Hello All, > > > > Can anyone recommend a

Re: [PHP] Zip Search

2010-04-15 Thread Nathan Nobbe
On Thu, Apr 15, 2010 at 1:51 PM, Tommy Pham wrote: > > -Original Message- > > From: Nathan Nobbe [mailto:quickshif...@gmail.com] > > Sent: Thursday, April 15, 2010 12:41 PM > > To: Jack > > Cc: php-general@lists.php.net > > Subject: Re: [PHP] Zip Search > > > > On Thu, Apr 15, 2010 at 1:2

Re: [PHP] Zip Search

2010-04-15 Thread Jason Pruim
On Apr 15, 2010, at 3:21 PM, Jack wrote: Hello All, Can anyone recommend a good open source zip code search application and database? If it's us zip's you want... I'd go straight to the source... http://www.usps.com/zip4/welcome.htm?from=home_header&page=findazipcode The post office a

Re: [PHP] Basic switch statement

2010-04-15 Thread Jason Pruim
On Apr 15, 2010, at 8:55 AM, tedd wrote: At 4:13 PM -0400 4/14/10, Al wrote: Incidentally, about formatting scripts, one of the reasons I like phpEdit is that it has a terrific code beautifier. You can set it for phpDoc or Pear rendering. And, it auto indents, etc. as you enter stuff.

Re: [PHP] Basic switch statement

2010-04-15 Thread Jason Pruim
On Apr 15, 2010, at 9:24 AM, Ashley Sheridan wrote: On Thu, 2010-04-15 at 08:55 -0400, tedd wrote: Have you tried Coder on the Mac? Most developers I know who use Macs (it's not the oxymoron it sounds! :p ) Most Mac people would say the morons use Windows ;) But that's another story f

Re: [PHP] Basic switch statement

2010-04-15 Thread Adam Richardson
On Thu, Apr 15, 2010 at 5:55 PM, Jason Pruim wrote: > > On Apr 15, 2010, at 8:55 AM, tedd wrote: > > At 4:13 PM -0400 4/14/10, Al wrote: >> >>> Incidentally, about formatting scripts, one of the reasons I like phpEdit >>> is that it has a terrific code beautifier. You can set it for phpDoc or >>

Re: [PHP] class attributes and __construct

2010-04-15 Thread Larry Garfield
On Thursday 15 April 2010 08:37:40 am Ashley Sheridan wrote: > I know I could move it to __construct and give it a default value in the > arguments list, but that brings it's own problems. What if the argument > list grows too big, and which attribute would be deemed more important > than another