Re: concatenation operator
| From: | Adi Mutu | Date: | Thu, 07 Jun 2012 19:53:44 +0000 |
| Subject: | Re: concatenation operator | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60778@lists.php.net to get a copy of this message | ||
Ok Johannes, thanks for the answer. I'll try to look deeper.
I basically just wanted to know what happens when you concatenate two strings? what emalloc/efree
happens.
Also can you tell me if possible how to put a breakpoint to emalloc/efree which are executed only
after all core functions are registered? because it takes like a million years like this and a
million F8 presses...
Thanks.
________________________________
From: Johannes Schlüter <johannes@schlueters.de>
To: Adi Mutu <adi_mutu06@yahoo.com>
Cc: Felipe Pena <felipensp@gmail.com>; PHP Developers Mailing List
<internals@lists.php.net>
Sent: Thursday, June 7, 2012 10:44 PM
Subject: Re: [PHP-DEV] concatenation operator
On Thu, 2012-06-07 at 11:50 -0700, Adi Mutu wrote:
>
> that's nice, but i haven't understood a thing...i know something about
> php core and php extensions, but nothing about the Zend engine
> specific.
The mentioned place is directly in the VM, which in general is harder to
understand, but well, it directs to the "concat_function" on
http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_operators.c#1234
Knowing basic C should be enough to understand the code there. The
actual "algorithm" can also easily be guessed (allocate a buffer which
can hold both strings at once and copy them over,the code is a tiny bit
more complex as it tries tore use an existing buffer than allocating
something completely new)
The question is: What do you actually want to know?
> Can you point me to some resources on this topic?
Unfortunately not. The source is the best documentation we have for
that.
johannes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php