[PHP-DEV] PHP 4.0 Bug #6950: make extract() return true or false From: rwidmer <email protected>
Date: 09/29/00

From: rwidmer <email protected>
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.

-- 
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>