PHP in(e)ternal - how is return value handled?
| From: | HKG) | Date: | Mon, 09 Feb 2004 10:58:22 +0000 |
| Subject: | PHP in(e)ternal - how is return value handled? | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-22776@lists.php.net to get a copy of this message | ||
As an old brain damged C programmer I have a question
about PHP's behaviour when it returns data from a function:
How does PHP internally return data from a function?
Assume for instance this:
$job[JOB_STATUS] = $data[JOB_STATUS]);
$job[JOB_ID] = $data[JOB_ID]);
$job[JOB_DAY] = $data[JOB_DAY]);
$job[JOB_TIME] = $data[JOB_TIME]);
$job[JOB_CMD] = $data[JOB_CMD]);
return $job;
Will PHP internally return the data structure of $job via
the heap. i.e. a copy operation, or just a pointer to $job?
Or do I need to use reference in order to return a pointer,
or even if I uses a reference will php internaly copy data
via the heap and then give me a pointerto the copy - scary
thought -?