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
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
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
>> 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 (
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
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
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
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
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
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
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
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
> -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
Hello All,
Can anyone recommend a good open source zip code search application and
database?
Thanks,
Jack
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
> -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
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
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
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.
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
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
>>
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
22 matches
Mail list logo