Home >Backend Development >PHP Tutorial >PHP扩展 怎么访问常量属性

PHP扩展 怎么访问常量属性

WBOY
WBOYOriginal
2016-06-06 20:49:151044browse

请问:在php扩展中用zend_declare_class_constant_stringl定义的常量属性 怎么访问? 我用zend_read_static_propertyzend_read_property都不行?

回复内容:

请问:在php扩展中用zend_declare_class_constant_stringl定义的常量属性 怎么访问? 我用zend_read_static_propertyzend_read_property都不行?

<code class="lang-cpp">ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSRMLS_DC);
ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC);
</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn