note 41909 modified in zend.variables by gwynne

From: Date: Mon, 18 Jun 2007 17:56:56 +0000
Subject: note 41909 modified in zend.variables by gwynne
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-127552@lists.php.net to get a copy of this message
If you want to free zval, you can do this: { zval *new_var; /* allocate and initialize new container */ MAKE_STD_ZVAL(new_var); /* set type and variable contents here, see the following sections */ ZVAL_STRING(new_var, "123456", 1); /* introduce this variable by the name "new_variable_name" into the symbol table */ zend_hash_update( EG(active_symbol_table), "new_var", strlen("new_var") + 1, &new_var, sizeof(zval *), NULL ); zend_hash_del( EG(active_symbol_table), "new_var", strlen("new_var") + 1); FREE_ZVAL(new_var); } --was-- If you want to free zval, you can do this: { zval *new_var; /* allocate and initialize new container */ MAKE_STD_ZVAL(new_var); /* set type and variable contents here, see the following sections */ ZVAL_STRING(new_var, "123456", 1); /* introduce this variable by the name "new_variable_name" into the symbol table */ zend_hash_update( EG(active_symbol_table), "new_var", strlen("new_var") + 1, &new_var, sizeof(zval *), NULL ); zend_hash_del( EG(active_symbol_table), "new_var", strlen("new_var") + 1); FREE_ZVAL(new_var); } http://php.net/manual/en/zend.variables.php

« previous php.notes (#127552) next »