# TSRMLS_* keywords in PHP source

- Thread: https://externals.io/message/59054
- Original archive: https://news-web.php.net/php.internals/59054
- Started by Barbu Paul Gheorghe on 2012-03-19T19:45:39+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #59054 — Barbu Paul Gheorghe — 2012-03-19T19:45:39+00:00

URL: https://externals.io/message/59054#59054

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

---

## #59055 — Jelle Zijlstra — 2012-03-19T19:50:28+00:00

URL: https://externals.io/message/59054#59055 · In reply to: #59054

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.com>

> 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<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

---

## #59062 — Richard Lynch — 2012-03-19T20:54:03+00:00

URL: https://externals.io/message/59054#59062 · In reply to: #59054

> 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
