Re: Critical Thinking, or Several "Why" Questions

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

 



Jay Blanchard wrote:
> [snip]
> Why include_once() is doing some fancy logic, which nobody needs?

I need it.  If you don't need it, don't use it.

> Why array_shift() re-indexes arrays?

Because most people *expect* it to behave that way.

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

Not sure.

> Why microtime(TRUE) returns only fraction of real time that is smaller
> than 1?

Because that's the way it was designed.  It's an optional (read:
different) way to get the microtime.

> Why microtime() does not return float in the first place?

Not sure.

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

Design choice.  Those functions are for storing / retrieving / etc.
session data and (in case you didn't know) when session data gets
written to disk (default handler) it is serialized.

You don't like the default serialize()?  Then unserialize() first and
write your own.  Even better: write a C extension as Jay suggested.

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

Not sure.

All of your performance questions require a thorough understanding of C
coding.  So you can either invest time in understanding C (so that you
can view / modify PHP's source code) or you can simply accept that it is
the way that it is.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

Attachment: signature.asc
Description: OpenPGP digital signature


[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