Welcome! Log In Create A New Profile

Advanced

[PHP-DEV] TSRMLS_* keywords in PHP source

Posted by Barbu Paul Gheorghe 
Barbu Paul Gheorghe
[PHP-DEV] TSRMLS_* keywords in PHP source
March 19, 2012 08:50PM
Hello!

What role does the keywords TSRMLS_CC, TSRMLS_DC, TSRMLS_D have when passed
along with a argument in PHP's source?
For example in this random file:

http://lxr.php.net/opengrok/xref/PHP_5_4/ext/intl/formatter/formatter_data.c


I don't even know if "keyword" is the right technical term for it because it's
the first time I see this kind of call in C:

foo(data_type variable_name "keyword");

--
Barbu Paul - Gheorghe
Common sense is not so common - Voltaire
Visit My GitHub profile to see my open-source projects - https://github.com/paullik

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Jelle Zijlstra
Re: [PHP-DEV] TSRMLS_* keywords in PHP source
March 19, 2012 09:00PM
Those are macros that are defined only if PHP's Thread-Safe Resource
Manager is enabled at compile time; it passes in additional information
needed by the TSRM.

2012/3/19 Barbu Paul Gheorghe <paullik.paul@gmail[email protected]>

> Hello!
>
> What role does the keywords TSRMLS_CC, TSRMLS_DC, TSRMLS_D have when
> passed along with a argument in PHP's source?
> For example in this random file:
>
> http://lxr.php.net/opengrok/**xref/PHP_5_4/ext/intl/**
> formatter/formatter_data.chttp://lxr.php.net/opengrok/xref/PHP_5_4/ext/intl/formatter/formatter_data.c
>
>
> I don't even know if "keyword" is the right technical term for it because
> it's the first time I see this kind of call in C:
>
> foo(data_type variable_name "keyword");
>
> --
> Barbu Paul - Gheorghe
> Common sense is not so common - Voltaire
> Visit My GitHub profile to see my open-source projects -
> https://github.com/paullik
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Richard Lynch
Re: [PHP-DEV] TSRMLS_* keywords in PHP source
March 19, 2012 10:00PM
On Mon, March 19, 2012 2:45 pm, Barbu Paul Gheorghe wrote:
> What role does the keywords TSRMLS_CC, TSRMLS_DC, TSRMLS_D have when
> passed
> along with a argument in PHP's source?
> For example in this random file:
>
> http://lxr.php.net/opengrok/xref/PHP_5_4/ext/intl/formatter/formatter_data.c
>
>
> I don't even know if "keyword" is the right technical term for it
> because it's
> the first time I see this kind of call in C:

It's a macro.

You can find it in the zend / tsrm files.

If I recall correctly the _CC and _DC and _D have to do with whether
you need a comma (,) after the macro or not...

It's been awhile, so don't quote me on that.

--
brain cancer update:
http://richardlynch.blogspot.com/search/label/brain%20tumor
Donate:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE



--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Yannick Komotir
Re: [PHP-DEV] TSRMLS_* keywords in PHP source
March 21, 2012 11:40AM
Hi,

You can find some additional information in this blog post
http://blog.golemon.com/2006/06/what-heck-is-tsrmlscc-anyway.html

Regards,

2012/3/19 Barbu Paul Gheorghe <[email protected]>

> Hello!
>
> What role does the keywords TSRMLS_CC, TSRMLS_DC, TSRMLS_D have when
> passed along with a argument in PHP's source?
> For example in this random file:
>
> http://lxr.php.net/opengrok/**xref/PHP_5_4/ext/intl/**
> formatter/formatter_data.chttp://lxr.php.net/opengrok/xref/PHP_5_4/ext/intl/formatter/formatter_data.c
>
>
> I don't even know if "keyword" is the right technical term for it because
> it's the first time I see this kind of call in C:
>
> foo(data_type variable_name "keyword");
>
> --
> Barbu Paul - Gheorghe
> Common sense is not so common - Voltaire
> Visit My GitHub profile to see my open-source projects -
> https://github.com/paullik

--
Yannick

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login