Issues

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

Issue Type: Bug Created: 2011-01-20T18:05:24.000+0000 Last Updated: 2011-01-21T08:29:21.000+0000 Status: Resolved Fix version(s): - 1.11.3 (01/Feb/11)

Reporter: netroby (netroby) Assignee: Mickael Perraud (mikaelkael) Tags: - Zend_Db

Related issues: Attachments:

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

Posted by Mickael Perraud (mikaelkael) on 2011-01-21T08:29:18.000+0000

Fixed with r23643 (replace array_walk by array_map)

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts