PHP 4.0 Bug #6950: make extract() return true or false
| From: | rwidmer at developersdesk dot com | Date: | Fri, 29 Sep 2000 23:59:34 +0000 |
| Subject: | PHP 4.0 Bug #6950: make extract() return true or false | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-33882@lists.php.net to get a copy of this message | ||
From: rwidmer@developersdesk.com
Operating system: Linux (SUSE 6.3)
PHP version: 4.0.2
PHP Bug Type: Feature/Change Request
Bug description: make extract() return true or false
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.