ZF-7491: Zend_Db_Select issues after upgrading to PHP 5.3

Issue Type: Bug Created: 2009-08-05T10:13:15.000+0000 Last Updated: 2009-11-21T01:14:46.000+0000 Status: Resolved Fix version(s): - 1.9.6 (24/Nov/09)

Reporter: Christopher Valderrama (gatorv) Assignee: Mickael Perraud (mikaelkael) Tags: - Zend_Db_Select

Related issues: Attachments:


On PHP5.2, if you do a simple select:

<pre class="highlight">
$oQuery = $oDB->select();
$oQuery->from('table1', '*');
$oQuery->joinLeft(array('table2'), '');

This will get assembled as: SELECT table1.*, table2.* FROM table1 LEFT JOIN table2 ON

On PHP5.3 it assembles as: SELECT table1.*, table2.* FROM table1 LEFT JOIN Array.`` AS table2 ON

The issue is on lines 785 / 787 of Zend/Db/Select.php, prior to PHP5.3 strpos returned false if the argument was not a string or not found, now it returns null if the first argument is not a string.

The patch to get it working is to add a !is_array to the if:

<pre class="highlight">
if (!is_object($tableName) && !is_array($tableName) && false !== strpos($tableName, '.')) {
    list($schema, $tableName) = explode('.', $tableName);


Posted by Mickael Perraud (mikaelkael) on 2009-11-21T01:14:45.000+0000

Test added with r19153 But cannot reproduce Do you have your own extension of Zend_Db_Select? Please reopen if necessary with more informations about environment (OS, PHP, RDBMS version)

Have you found an issue?

See the Overview section for more details.


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

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