cvs: php4 /ext/standard array.c

From: Date: Mon, 08 Jan 2001 20:57:59 +0000
Subject: cvs: php4 /ext/standard array.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-3491@lists.php.net to get a copy of this message
andrei Mon Jan 8 12:57:59 2001 EDT Modified files: /php4/ext/standard array.c Log: @- Changed extract() to return the number of variables extracted. (Andrei) Index: php4/ext/standard/array.c diff -u php4/ext/standard/array.c:1.87 php4/ext/standard/array.c:1.88 --- php4/ext/standard/array.c:1.87 Thu Dec 28 15:50:42 2000 +++ php4/ext/standard/array.c Mon Jan 8 12:57:59 2001 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.87 2000/12/28 23:50:42 venaas Exp $ */ +/* $Id: array.c,v 1.88 2001/01/08 20:57:59 andrei Exp $ */ #include "php.h" #include "php_ini.h" @@ -1109,7 +1109,7 @@ /* }}} */ -/* {{{ proto void extract(array var_array, int extract_type [, string prefix]) +/* {{{ proto int extract(array var_array, int extract_type [, string prefix]) Imports variables into symbol table from an array */ PHP_FUNCTION(extract) { @@ -1117,7 +1117,7 @@ zval **entry, *data; char *varname, *finalname; ulong lkey; - int res, extype; + int res, extype, count = 0; switch(ZEND_NUM_ARGS()) { case 1: @@ -1203,12 +1203,16 @@ ZEND_SET_SYMBOL(EG(active_symbol_table), finalname, data); efree(finalname); + + count++; } } } zend_hash_move_forward(Z_ARRVAL_PP(var_array)); } + + RETURN_LONG(count); } /* }}} */

« previous php.cvs (#3491) next »