Re: Array declarations
| From: | Ernest E Vogelsinger | Date: | Wed, 19 Feb 2003 17:10:12 +0000 |
| Subject: | Re: Array declarations | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-136212@lists.php.net to get a copy of this message | ||
At 22:56 18.02.2003, Joachim Krebs spoke out and said:
--------------------[snip]--------------------
>Is there any speed difference at all from the following two code
>blocks (miniscule or not)? If so, which is faster?
>
>$cfg["db"]["host"] = "xxxx";
>$cfg["db"]["user"] = "yyyy";
>$cfg["db"]["pass"] = "zzzz";
>
>or
>
>$cfg["db"] = array("host"=>"xxxx",
>"user"=>"yyyy", "pass"=>"zzzz");
--------------------[snip]--------------------
The difference is minimal. On our 2xPIII/1GHz Dell server, iterating both
methods 100.000 times, the second method performs 0.18 seconds faster than
the first. This result is stable for more than 100 passes.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/