Re: 5.NEXT Integer and String type modifications
| From: | Michael Wallner | Date: | Tue, 04 Jun 2013 04:59:22 +0000 |
| Subject: | Re: 5.NEXT Integer and String type modifications | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67620@lists.php.net to get a copy of this message | ||
On 2 June 2013 11:11, Johannes Schlüter <johannes@schlueters.de> wrote:
>
>
> 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))
+1 for the idea
+1 for Z_STRSIZE
+1 for volunteering, as far as time permits!
--
Regards,
Mike