Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sara Goleman's Blog:
What the heck is TSRMLS_CC anyway?
Jun 02, 2006 @ 10:56:55

Sara Goleman, a definite specialist in the internals of PHP, has posted This new item on her blog today with details on a construct that's a bit mysterious, but pervasive in the code - TSRMLS_CC.

Those who know what this is typically answer questions from those who don't with "Don't worry about what it is, just use it here here here and here. And if the compiler says you're missing a tsrm_ls, put it there too..." This isn't laziness on the part of the person answering the question (okay, maybe it is a little bit), it's just that the engine goes so far out of its way to simplify what this magic values does, that there's no profit in a new extension developer knowing the mechanics of it. The information is like a cow's opinion, it doesn't matter, it's Moo.

Since I love to listen to myself rattle on about pointless topics (and I havn't blogged much this month), I thought I'd cover this topic and see if anyone manages to stay awake through it.

In the remainder of the post, she breaks it down into its components and explains what each means. At its base level, it helps manage the differences between code using the "Zend Thread Safety" functionality and the code that's not. To illustrate the point, she provides two examples - one with globals and one with "non-global globals". Of course, this functionality isn't any good if you can't get to the constructs you need, so she includes an example macro to accomplish just that.

tagged: source tsrmls_cc thread resource zend local storage source tsrmls_cc thread resource zend local storage

Link:

Sara Goleman's Blog:
What the heck is TSRMLS_CC anyway?
Jun 02, 2006 @ 10:56:55

Sara Goleman, a definite specialist in the internals of PHP, has posted This new item on her blog today with details on a construct that's a bit mysterious, but pervasive in the code - TSRMLS_CC.

Those who know what this is typically answer questions from those who don't with "Don't worry about what it is, just use it here here here and here. And if the compiler says you're missing a tsrm_ls, put it there too..." This isn't laziness on the part of the person answering the question (okay, maybe it is a little bit), it's just that the engine goes so far out of its way to simplify what this magic values does, that there's no profit in a new extension developer knowing the mechanics of it. The information is like a cow's opinion, it doesn't matter, it's Moo.

Since I love to listen to myself rattle on about pointless topics (and I havn't blogged much this month), I thought I'd cover this topic and see if anyone manages to stay awake through it.

In the remainder of the post, she breaks it down into its components and explains what each means. At its base level, it helps manage the differences between code using the "Zend Thread Safety" functionality and the code that's not. To illustrate the point, she provides two examples - one with globals and one with "non-global globals". Of course, this functionality isn't any good if you can't get to the constructs you need, so she includes an example macro to accomplish just that.

tagged: source tsrmls_cc thread resource zend local storage source tsrmls_cc thread resource zend local storage

Link:


Trending Topics: