RE: Brain Death - [PHP] functions classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cool!  That is a very good point - I'll remember to use '=== null' in future.  Then at least my code will have enough coffee even if I don't!

Thanks - AJ

Alexander J Turner Ph.D.
www.deployview.com
www.nerds-central.blogspot.com
www.project-network.com

-----Original Message-----
From: Robert Cummings [mailto:robert@xxxxxxxxxxxxx] 
Sent: 26 August 2006 17:25
To: Alex Turner
Cc: php-general@xxxxxxxxxxxxx
Subject: RE:  Brain Death - [PHP] functions classes

On Sat, 2006-08-26 at 16:51 +0100, Alex Turner wrote:
> Rob,
> 
> I'd go along with the setting a var to null issue (in the cases
> I have worked so far on, there has not been a need to set variables
> to null).


Maybe so, but if a variable ever happens to contain null and you're not
aware of it, the value won't get updated.

> However, what is wrong with is_null()?

As a function call it's an order of magnitude slower than === null since
it incurs the overhead for a function call. There's nothing wrong with
your use of the is_null() function, but === null is just as clear, and
much faster so I thought I'd throw at you in line with your coffee
comment :)

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.          |
`------------------------------------------------------------'


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.6/427 - Release Date: 24/08/2006
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.6/427 - Release Date: 24/08/2006
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux