Home  >  Article  >  Backend Development  >  Variable setting and destruction in PHP extension development

Variable setting and destruction in PHP extension development

不言
不言Original
2018-05-09 09:53:561388browse

This article mainly introduces the setting and destruction of variables in PHP extension development. It has certain reference value. Now I share it with you. Friends in need can refer to it.

//定义变量
zval *op;
//分配内存
MAKE_STD_ZVAL(op);
//赋值
ZVAL_LOGN(op, 0);
//获取 op 的值
if  (Z_LVAL_P(op))
{    
php_printf("%s", "true");
}
else
{    
php_printf("%s", "true");
}
//销毁变量
opzval_ptr_dtor(&op);

The above is the content of this article. All the content is there, please pay attention to the PHP Chinese website for more related content.

Related recommendations:

PHP extension development to develop our own interface class

             

The above is the detailed content of Variable setting and destruction in PHP extension development. For more information, please follow other related articles on the PHP Chinese website!

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