Performance tests: Default arguments

at 2006-08-15 in Experiments by friebe (0 comments)

Assume we have the following function:

  function fixture($r1, $r2, $o1= array(1, 2), $o2= NULL, $o3= 'foo') {
// ...
}

What's faster? Calling it via fixture(1, 2) or supplying all the default arguments (fixture(1, 2, array(1, 2), NULL, 'foo');). The answer is: It's equivalent.

See this experiment for details.



Subscribe

You can subscribe to the XP framework's news by using RSS syndication.


Categories

News
General
PHP5
Announcements
RFCs
Further reading
Examples
Editorial
EASC
Experiments
Unittests
Databases
5.8-SERIES
Unicode
Language
5.9-SERIES

Related

Find related articles by a search for «Performance».