PHP:如何检测代码中的当前列(eq. __COLUMN__)?
我需要获取代码中函数调用当前位置的唯一标识符(以便在模板中使用它)。 所以,我需要类似的东西:
$uid = __FILE__ . __LINE__ . __COLUMN__;
Does PHP have anything like __COLUMN__
?I need to get unique identificator for current place of function call in code (for using it in template).
So, i need something like:
$uid = __FILE__ . __LINE__ . __COLUMN__;
Does PHP have anything like __COLUMN__
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不这么认为,不。
魔法常量部分没有提到这样的事情手册的内容。
然而,按理说,人们不应该太需要它。如果一行源代码太长以至于需要列号作为信息,则可能应该将其分解。
I don't think so, no.
There is no mention of such a thing in the magic constants section of the manual.
However, it stands to reason one shouldn't be needing that too badly. If a line of source code is so long that it needs the column number as an information, it should probably be broken up.