note 50004 rejected from language.oop.newref by nlopess
| From: | nlopess@php.net | Date: | Tue, 15 Feb 2005 11:29:05 +0000 |
| Subject: | note 50004 rejected from language.oop.newref by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-85065@lists.php.net to get a copy of this message | ||
Note Submitter: riseofthethorax at earthlink dot net
----
What stupid things are you doing with
PHP that would cause a reference to take longer than a copy?
In C using references takes no time as they are nothing by indexes into memory.. Copies imply a copy
byte operation which never takes constant time.. Makes me think PHP developers are complete
imbeciles, or the guys who write these manuals..
When I came upon the error "pass-by-reference" deprecated,
I could foresee the plod of lunacy going about.. I had discussed this with the coder of
"singapore" and she seemed to think copys take less time than references, and you are
saying the same thing..
So why in C does this take no time:
char *a = "this is a string";
char *p = a;
If you can prove to me that this takes less time
than
p = malloc(sizeof(a)) + 1;
memcpy(p,a)
p[sizeof(a)] = null;
Then I probably can tell you why John Kerry didn't get elected..