Re: http://bugs.php.net/bugs.php?id=8409
| From: | Andrei Zmievski | Date: | Mon, 08 Jan 2001 21:40:24 +0000 |
| Subject: | Re: http://bugs.php.net/bugs.php?id=8409 | ||
| References: | 1 2 3 4 5 6 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-43471@lists.php.net to get a copy of this message | ||
On Mon, 08 Jan 2001, Stig Venaas wrote:
> Great, I'll fix the doc.
>
> I see two problems with the extract() code. You check that the key
> is a legal variable name but not that prefix_key is. There are two
> problems with this.
>
>
>
> $a = array( '1a' => 'b' ) ;
> extract($a, EXTR_PREFIX_ALL , 'prefix') ;
>
> should set $prefix_1a but doesn't since '1a' isn't legal.
>
>
>
> and
>
>
>
> $a = array( 'a' => 'b' ) ;
> echo extract($a, EXTR_PREFIX_ALL , '1prefix') ;
>
> puts the key (variable) '1prefix_a' into the symbol table.
Ok, I'll fix it, but give me a break, extract() was the very first
function I wrote, after all. :)
-Andrei
* I wish life had an UNDO function. *