|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi!
It just crossed my mind, that I usually do it like this: $whatver=$_POST["returned_value"]; instead of $whatver=$_POST['returned_value']; The latter should be faster, as within ' nothing is replaced as in ". I now wornder, what difference this makes in speed? It should make some, but not really.... then again, with 10000000 users, it might. What do you do? WBR Sonnich |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 30 Apr, 13:08, jodleren <sonn...@hot.ee> wrote:
> Hi! > > It just crossed my mind, that I usually do it like this: > > $whatver=$_POST["returned_value"]; > > instead of > > $whatver=$_POST['returned_value']; > > The latter should be faster, as within ' nothing is replaced as in ". > I now wornder, what difference this makes in speed? > It should make some, but not really.... then again, with 10000000 > users, it might. > > What do you do? If it it was that important to me I'd: 1) research the issue - which is well documented 2) test it for myself and perhaps even share my findings. C. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
jodleren wrote:
> Hi! > > It just crossed my mind, that I usually do it like this: > > $whatver=$_POST["returned_value"]; > > instead of > > $whatver=$_POST['returned_value']; > > The latter should be faster, as within ' nothing is replaced as in ". > I now wornder, what difference this makes in speed? > It should make some, but not really.... then again, with 10000000 > users, it might. > > What do you do? > > WBR > Sonnich > I generally use single quotes, mostly out of habit. But the difference is going to be negligible. And if you have so many users that it's overloading your system, chances are other things will contribute more to enhancing your performance. Don't try to prematurely optimize. All it will do is delay your project and give you ulcers. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
jodleren wrote:
> Hi! > > It just crossed my mind, that I usually do it like this: > > $whatver=$_POST["returned_value"]; > > instead of > > $whatver=$_POST['returned_value']; > > The latter should be faster, as within ' nothing is replaced as in ". > I now wornder, what difference this makes in speed? > It should make some, but not really.... then again, with 10000000 > users, it might. > > What do you do? The difference is too small to care about - even with 10M Users. I can't say whats faster because the difference is so small that if i iterate both methods 10M times the result get corrupted by external factors like if there are other tasks that "steal" cpu time. From the logical point of view single quotes should be faster because single quotes don't support varibale substitution. Personally i use double quotes all the time. Joe |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
jodleren a écrit :
> What do you do? I almost always use single quotes, because of those variables not treated, if I want to include one I explicitely do it. Almost, cause I use double quotes in SQL queries, where I use single quote for value statements (and always use curly brackets for variables, which makes it clearer imo to delimitate the variable names) "INSERT INTO dummy (name) VALUES ('{$name}')" Regards, -- Guillaume |
|
![]() |
| Outils de la discussion | |
|
|