5
 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
  return;
 }

Especially what's ZEND_NUM_ARGS() TSRMLS_CC doing?

DaveRandom
  • 87,921
  • 11
  • 154
  • 174
ccr
  • 81
  • 1

4 Answers4

5

It looks like TSRMLS_CC is a macro that might expand to nothing or it might expand to an extra argument with a comma thrown in there:

http://blog.golemon.com/2006/06/what-heck-is-tsrmlscc-anyway.html

xscott
  • 2,350
  • 16
  • 18
4

This Zend article says:

The bulk of the zend_parse_parameters() block will almost always look the same. ZEND_NUM_ARGS() provides a hint to the Zend Engine about the parameters which are to be retrieved, TSRMLS_CC is present to ensure thread safety

codaddict
  • 445,704
  • 82
  • 492
  • 529
1

http://docstore.mik.ua/orelly/webprog/php/ch14_07.htm

Andrew Cash
  • 2,321
  • 1
  • 17
  • 11