You are here: Re: Performance impact about unquoted strings « PHP Programming Language « IT news, forums, messages
Re: Performance impact about unquoted strings

Posted by Chung Leong on 09/13/06 03:51

Jerry Stuckle wrote:
> Yes, it will take longer to execute and require more CPU. Rather than
> just accept the value as a string, the parser has to search through
> defined values to see if each string is defined or not. Additionally,
> PHP generates a notification for each one. The notification itself can
> be turned off, but the error handler still needs to run to find out the
> notification is not to be sent.

To be a little more precise, PHP would perform two look-ups in the
constant hash-table: once for case-sensititve match, another time for
case-insenstitive match. The overhead isn't that high, but it's
definitely slower than a literal string.

The bigger problem is the chance of a constant being defined under that
name. Not a recommended practice at all.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация