0

While reading about PHP Zend Engine internals, I came across function zend_parse_parameters() which is used as the following

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &number) != SUCCESS) { return; }

I am confused about the first parameter as this consists of two separate entities separated by space: ZEND_NUM_ARGS() and TSRMLS_CC. I have never seen such thing in C like this. Can someone explain how to comprehend this within C syntax rules? The prototype of zend_parse_parameters()is as under:

int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...)

Nadir
  • 13
  • 1
  • 5
  • 1
    `TSRMLS_CC` is a macro that either expands into something starting with a comma or nothing at all – asimes Feb 22 '19 at 07:34

1 Answers1

0

From the C point of view ZEND_NUM_ARGS, TSRMLS_CC and TSRMLS_DC are just macros. They are specific to Zend internals. This article explain their usage and to what they would expand: http://blog.golemon.com/2006/06/what-heck-is-tsrmlscc-anyway.html

aminosbh
  • 193
  • 1
  • 5