RE: Critical Thinking, or Several "Why" Questions

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

 



[snip]
Why include_once() is doing some fancy logic, which nobody needs?
Why array_shift() re-indexes arrays?
Why 2 simple string comparisons are slower than one preg_match()?
Why microtime(TRUE) returns only fraction of real time that is smaller 
than 1?
Why microtime() does not return float in the first place?
Why user-defined session-handling functions receive serialized session 
data that is already serialized?
Why parser reads multi-line comment slower than it reads heredoc or 
single-quoted string?


Why don't you RTFM?

There is nothing in manual that answers any of those questions.
[/snip]

I'll get you started....(picked at random)

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

from http://www.php.net/microtime
*******************************************
microtime
(PHP 3, PHP 4 , PHP 5)

microtime --  Return current Unix timestamp with microseconds 
Description
mixed microtime ( [bool get_as_float] )


microtime() returns the current Unix timestamp with microseconds. This
function is only available on operating systems that support the
gettimeofday() system call. 

When called without the optional argument, this function returns the
string "msec sec" where sec is the current time measured in the number
of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and msec
is the microseconds part. Both portions of the string are returned in
units of seconds. 
*********************************************

And another....

Why include_once() is doing some fancy logic, which nobody needs?

What fancy logic? And why does no one need it?

>From http://www.php.net/include_once
*********************************************
include_once()
The include_once() statement includes and evaluates the specified file
during the execution of the script. This is a behavior similar to the
include() statement, with the only difference being that if the code
from a file has already been included, it will not be included again. As
the name suggests, it will be included just once. 

include_once() should be used in cases where the same file might be
included and evaluated more than once during a particular execution of a
script, and you want to be sure that it is included exactly once to
avoid problems with function redefinitions, variable value
reassignments, etc. 
*********************************************

Now surely you can RTFM and find more answers. If you disagree with the
way that some things work you have a couple of options;

a. Contact the PHP development group and explain what you would like to
happen.
2. Write an extension yourself that 'fixes' the items you have questions
about.

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