Re: Re: Performance update involving zval containers. Why not possible?
| From: | Paul Taulborg | Date: | Sat, 21 Sep 2013 12:54:33 +0000 |
| Subject: | Re: Re: Performance update involving zval containers. Why not possible? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69251@lists.php.net to get a copy of this message | ||
On Fri, Sep 20, 2013 at 10:01 AM, ruben <ruben.santacruz@gmail.com> wrote:
> Pascal Chevrel wrote:
>
>> Le 20/09/2013 14:06, ruben a écrit :
>>
>>> Hi,
>>>
>>> first of all I want to say that I am just a newbie in PHP. I am
>>> switching to PHP from other languages and I am exploring how PHP manages
>>> references. To do that I am gathering information about what happens
>>> with Symbol Tables and Variables Containers when using references. You
>>> know: reference-counting, copy-on-write and all that stuff...
>>>
>>> I found out some cases where I think that some Variable Containers
>>> copies could be skipped, thus saving memory and improving performance
>>> relying in the copy-on-write principle. I wrote a PDF trying to explain
>>> what I mean. It is not written in a very techy language, because I am
>>> just new and don't know too much about the internals, but I hope you can
>>> understand it and post your comments.
>>>
>>> Probably if my "update" hasn't been done yet, is because it is not
>>> possible, but I will very glad to hear your comments and learn from you..
>>>
>>> Thank you very much.
>>>
>>>
>> Hi Ruben,
>>
>> I think you forgot to put a link to your pdf :)
>>
>> Regards,
>>
>> Pascal
>>
>
> Sorry, here it is:
> https://www.dropbox.com/s/wxdc99miw82zje9/PHP_references.pdf
Change the function to:
function & do_something(& $s) {
and it should do what you are expecting, reusing a single reference.
http://www.php.net/manual/en/language.references.return.php
for more
reference.