Re: Re: PATCH: anonymous functions in PHP
| From: | Marcus Boerger | Date: | Mon, 19 Mar 2007 07:48:00 +0000 |
| Subject: | Re: Re: PATCH: anonymous functions in PHP | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-28410@lists.php.net to get a copy of this message | ||
Hello Gwynne,
Monday, March 19, 2007, 3:13:28 AM, you wrote:
> On Mar 18, 2007, at 9:30 PM, Wez Furlong wrote:
>> Your nitpicking happens to be wrong ;-)
>>
>> sizeof("string constant") is the "same" as strlen("string
>> constant")
>> +1, but is resolved at compile time, so we use sizeof("string
>> constant")-1 to get a compile time evaluated strlen(). This trick
>> is used throughout the PHP internals.
> Ah. I've never seen it used that way before; I apologize for my
> ignorance :). In my experience, sizeof() on a character constant
> would evaluate as sizeof( const char * const ).
Actually it is not a "const char *" here. Instead the language generates
a "const char[]" which works asexpected.
Best regards,
Marcus