Re: [PHP-DEV] http://bugs.php.net/bugs.php?id=8409 From: Stig Venaas (Stig.Venaas <email protected>)
Date: 01/08/01

On Sat, Jan 06, 2001 at 04:58:53AM +0100, Cynic wrote:
> Can arrays in PHP change a bit, or are they carved in stone
> yet? Is, for example, change to extract() so that
>
> $a = array( 'aaa' , 'bbb' , 'ccc' ) ;
> extract( $a , EXTR_PREFIX_ALL , 'prefix' ) ;
>
> creates $prefix_1 , $prefix_2, and $prefix_3 in current scope?
> And what about changing it so that it returns? I'd like to see
> extract() return maybe number of variables it created.

This sounds like a good idea, should be backwards compatible. Except
that I think the result should be

creates $prefix0, $prefix1, and $prefix2 in your case. After all the
indices are 0, 1 and 2, and adding _ doesn't seem natural. You can
call your prefix prefix_ then.

To return the number of variables sounds good to me, but won't it
always be the same as the number of elements in the array?

Stig

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>