Issues

ZF-10974: Zend_Db Performance sample code mistake: utilize a combination of vsprintf() and array_walk() to inject the values into the SQL

Description

Zend_Db Performance sample code mistake: utilize a combination of {{vsprintf()}} and {{array_walk()}} to inject the values into the SQL

http://framework.zend.com/manual/en/…

by the document, it show us the sample code like below :

{quote} // $adapter is the DB adapter. In Zend_Db_Table, retrieve // it using $this->getAdapter(). $sql = vsprintf( self::SELECT_FOO, array_walk($values, array($adapter, 'quoteInto')) ); {quote}

but by the php manual, we know {{array_walk}} only return true or false .

http://us.php.net/array_walk http://us.php.net/vsprintf

so the {{vsprintf}} method did not return the right formatted sql as expected.

Comments

Fixed with r23643 (replace array_walk by array_map)