ZF-219: insert() parameter is array reference, so it cannot be an array literal

Issue Type: Bug Created: 2006-07-10T01:39:23.000+0000 Last Updated: 2007-07-05T14:43:13.000+0000 Status: Resolved Fix version(s): - 0.9.0 (17/Mar/07)

Reporter: Jonathan Adami (pitilezard) Assignee: Bill Karwin (bkarwin) Tags: - Zend_Db_Table

Related issues: Attachments:


That's it ! insert and update use an old php4 reference ( public function insert(& data) { ). It's unusefull in php5, isn't it ?


Posted by Matthew Turland (elazar) on 2006-07-20T11:01:22.000+0000

You may be thinking of the ability to explicitly pass by reference at call time.…

If not, I believe you are incorrect about the use of references not being useful here and in PHP 5 and in general and would advise you to read the manual section regarding references.…

In this particular case, I believe a reference was used for performance reasons so that the call time parameter would not be copied into the actual parameter since it has the potential to be large.

Posted by Jonathan Adami (pitilezard) on 2006-07-21T01:28:38.000+0000

Of course but this removes the availability of quick calls !!

You have to do :

<pre class="highlight">
$myarray = array(...);

instead of

<pre class="highlight">
insert(array( ... ));

That's not an amazing mistake, just a convenient way pruned !

My two cents ;)

Posted by Bill Karwin (bkarwin) on 2006-11-13T15:22:38.000+0000

Changing fix version to 0.8.0.

Posted by Bill Karwin (bkarwin) on 2007-01-05T17:06:24.000+0000

Recategorize as Zend_Db_Table component.

Posted by Bill Karwin (bkarwin) on 2007-04-04T14:31:37.000+0000

Resolve in revision 3658. Included in ZF 0.9.0.

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.