Reply to Re: [PHP] Critical Thinking, or Several "Why" Questions

Your name:

Reply:


Posted by Richard Lynch on 04/06/05 00:26

On Tue, April 5, 2005 11:44 am, GamblerZG said:
> Why include_once() is doing some fancy logic, which nobody needs?

Obviously somebody needed it, or they wouldn't have written it!

If you don't need it, you can roll your own in about 10 seconds, or you
could simply *NOT* use include_once and structure your code well enough
that you're never silly enough to include the same file twice.

> Why array_shift() re-indexes arrays?

Because that's what a POP function should do?

Though if you don't want this behaviour, use text indices, and it won't.

So there.

> Why 2 simple string comparisons are slower than one preg_match()?

Because preg_match is fast.

Also depends on the preg_match() expression.

Try it with something non-trivial.

> Why microtime(TRUE) returns only fraction of real time that is smaller
> than 1?
> Why microtime() does not return float in the first place?

You mean microtime(FALSE), and it returns a string that way because that's
the way the operating system does it.

PHP allows you to use TRUE to get the float you want. This was added
because users like you went to the source and fixed it.

> Why user-defined session-handling functions receive serialized session
> data that is already serialized?

Because you are almost for sure going to have to serialize it to store it
anyway, and PHP can do it faster in C than you can?

> Why parser reads multi-line comment slower than it reads heredoc or
> single-quoted string?

If you can make it faster, submit a patch.

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original 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

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