RE: [PHP] Brain Death - [PHP] functions classes
| From: | Robert Cummings | Date: | Sat, 26 Aug 2006 19:04:14 +0000 |
| Subject: | RE: [PHP] Brain Death - [PHP] functions classes | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241136@lists.php.net to get a copy of this message | ||
On Sat, 2006-08-26 at 14:23 -0400, tedd wrote:
> At 2:30 PM -0400 8/26/06, Robert Cummings wrote:
> >On Sat, 2006-08-26 at 12:41 -0400, tedd wrote:
> > > At 4:51 PM +0100 8/26/06, Alex Turner wrote:
> >> >And to be very pedantic - as null does not have a type then actually
> > > >'x === null' should evaluate to absurdity, but PHP is more pragmatic
> >> >than that ;-)
> >>
> >> That's a very good point.
> >>
> >> While one NULL variable in php can be compared to another NULL
> >> variable and produce true, it's not so in MySQL.
> >>
> >> In MySQL NULL does not equal NULL -- such comparisons produces NULL
> >> and not true. Instead you have to use IS_NULL or NOT NULL to check
> >> for NULL.
> >>
> >> So, it's probably best to get into the habit of using is_null.
> >
> >I strongly disagree... If I'm writing SQL then I adhere to the language
> >constructs of SQL, if I'm coding in PHP then I adhere to the language
> >constructs of PHP. There is no reason why one should forgo better
> >constructs just because they don't appear in other languages. When in
> >Rome... Oh btw, PHP draws strongly from C, and in C NULL == NULL, and
> >last I checked C predates SQL.
> >
> >Cheers,
> >Rob.
>
> Rob:
>
> As the old woman who kissed the cow said "To each their own."
>
> My reasoning is simple and I don't strongly agree, or disagree, with
> other methodologies. I write in several languages, such as php, js,
> mySQL, css, and others -- and each have their own constructs. As
> such, I try to use similar constructs where ever possible. My memory
> isn't what it used to be.
>
> Besides, what Alex Turner said about NULL is correct -- it's absurd
> to have NULL evaluate to anything. Just because one language allows
> absurdity doesn't mean you have to practice it.
One language? I know for certain that PHP, C, PERL, and JavaScript all
return true for comparisons of null to itself. I know quite a few
languages too... though I'm not sure why you threw CSS in there since
the concept of null doesn't apply.
> Your mileage may differ and that's Okay. :-)
As always :)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'