PHP 4.0 Bug #6950 Updated: make extract() return true or false
| From: | cynic@php.net | Date: | Tue, 23 Jan 2001 16:41:59 +0000 |
| Subject: | PHP 4.0 Bug #6950 Updated: make extract() return true or false | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-44827@lists.php.net to get a copy of this message | ||
ID: 6950
Updated by: cynic
Reported By: rwidmer@developersdesk.com
Old-Status: Open
Status: Closed
Bug Type: Feature/Change Request
Assigned To:
Comments:
extract() was recently changed to return the number of extracted variables, so I guess this can be
closed.
Previous Comments:
---------------------------------------------------------------------------
[2000-09-29 19:59:34] rwidmer@developersdesk.com
Please make extract() return true if there was an array to process, or false if the value of the
'array' parameter was not an array This change will simplify iterating a database, and
may be usefile elsewhere.
After the following query:
$Result = mysql_query( "SELECT Field1, Field2, Field3 FROM Table" );
you will be able to display the conents of the table with:
while( extract( mysql_fetch_array( $Result )) {
echo $Field1, $Field2, $Field3;
}
rather than:
while( $A = mysql_fetch_array( $Result )) {
extract( $A );
echo $Field1, $Field2, $Field3;
}
This change should not affect backwards compatability, as existing users of extract() don't
expect any return value.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6950