Re: 5.NEXT Integer and String type modifications
| From: | Johannes Schlüter | Date: | Sun, 02 Jun 2013 09:11:58 +0000 |
| Subject: | Re: 5.NEXT Integer and String type modifications | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67606@lists.php.net to get a copy of this message | ||
On Jun 2, 2013, at 8:34, Pierre Joye <pierre.php@gmail.com> wrote:
>> Obviously there's a pretty significant ABI break here. I propose a "tweak"
>> of the Z_* macros to "fix" that. Basically, Z_STRLEN() will cast the result
>> to an int. This is the same behavior as today, and will mean that existing
>> extensions continue to function exactly as today. But new extensions (and
>> elsewhere in core) can use a new macro Z_STRSIZE() which will return the
>> native size_t.
>
> A new macro will be a good solution, but I would name it what it
> actually is, Z_SIZE_T.
That's not what it is. It is the length of the string aka. var.value.str.length as such it
should indicate its relation to a string. So something like Z_STRSIZE is correct (and the name is
nice thinking about Unicode strings where length (characters) != size (bytes))
johannes