Re: Critical Thinking, or Several "Why" Questions

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

 



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

-- 
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