note 50004 added to language.oop.newref
| From: | riseofthethorax at earthlink dot net | Date: | Tue, 15 Feb 2005 06:19:20 +0000 |
| Subject: | note 50004 added to language.oop.newref | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85051@lists.php.net to get a copy of this message | ||
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..
----
Manual Page -- http://www.php.net/manual/en/language.oop.newref.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50004
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50004&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50004&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50004&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50004&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50004&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50004&report=yes
Search -- http://master.php.net/manage/user-notes.php