Setting Strings
Hello, I have a question, I need to place many names, which would be faster/efficient, declare the names in the same function, or create a variable with the list of names and then call them, here are differents ways
First Way: PHP Code:
PHP Code:
PHP Code:
|
Re: Setting Strings
I would normally do it the last way. I doubt there would be any significant performance difference but if the list gets long, it can make the last method much easier to update and maintain.
Even if you do need a switch for other things, you can simply use the switch for the things that absolutely need it. |
Re: Setting Strings
Quote:
The function will be called several times in short periods The list will be much longer (at least 20) based on this, it would be better to put the string directly, or call the variable that contains the saved string |
Re: Setting Strings
You are worring about things of no consequence. Use the second method because it is easier to maintain.
|
All times are GMT -4. The time now is 09:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.