Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Quercus

Reply
 
Thread Tools Display Modes
  #1  
Old 03-12-2013, 10:43 AM
gordon gordon is offline
Junior Member
 
Join Date: Jul 2012
Posts: 12
Default Error : ... each must reference an array

Hi,

I'm running Quercus 4.0.34 and have an odd problem. From this code

while (list($k,$v)=each($this->components->items))

I'm getting the following error

Fatal Error : variable passed to each must reference an array

Could this be a problem with the implementation of EACH() in Quercus? I think maybe that a false or null should be generated, not a fatal error.
Reply With Quote
  #2  
Old 03-12-2013, 06:48 PM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

Hi gordon,

Can you do a var_dump($this->components->items)?

Thanks.
Reply With Quote
  #3  
Old 03-13-2013, 11:25 AM
gordon gordon is offline
Junior Member
 
Join Date: Jul 2012
Posts: 12
Default Error : ... each must reference an array

Hi Nam,

I'm using Embarcadero HTML5 Builder and the error is raised in one of the supplied classes. When I do a var-dump it's over 43000 characters and I can't include it in the post. Do you want me to chop it down to 10000 so it will fit?

By the way, thanks for your help fixing the PDO/SQLite problem I had before. It's working fine now.

regards

Gord
Reply With Quote
  #4  
Old 03-13-2013, 12:34 PM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

I'm just looking for the general type of the argument. Is it an object or an array? And is it a reference? The first 100 characters would be very helpful. Thanks.
Reply With Quote
  #5  
Old 03-14-2013, 04:05 PM
gordon gordon is offline
Junior Member
 
Join Date: Jul 2012
Posts: 12
Default Error : ... each must reference an array

Hi Nam,

Here's the first bit of the var_dump

array(1) { [0]=> object(Page1) (144) { ["input"]=> object(Input) (1) {
["disable"]=> bool(false) } ["owner"]=> object(Application) (17)


classes.inc.php:1845:
Fatal Error: variable passed to each must reference an array

regards

Gord
Reply With Quote
  #6  
Old 03-15-2013, 04:39 PM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

Thanks gordon,

This error is now a warning instead of being a fatal one. I suspect that references are triggering the error. I put in a potential fix for it if that is indeed the case. Also, I added better debugging in case the error is still there.

All these changes are in our public svn repository. You can check it out, or I can build you a snapshot (let me know if you need a WAR file or a full Resin distribution).
Reply With Quote
  #7  
Old 03-18-2013, 04:14 PM
gordon gordon is offline
Junior Member
 
Join Date: Jul 2012
Posts: 12
Default Error : ... each must reference an array

Hi Nam,

Thanks once again for the super quick response.

I'm still only at the 'proof of concept' stage. I don't build myself and I'm not deploying with a WAR file, I just use Quercus via resin.jar.


regards

Gord
Reply With Quote
  #8  
Old 03-20-2013, 11:18 PM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

Hi gordon,

I sent you a link to a Resin snapshot via private message.
Reply With Quote
  #9  
Old 03-27-2013, 11:01 AM
gordon gordon is offline
Junior Member
 
Join Date: Jul 2012
Posts: 12
Default Error : ... each must reference an array

Hi Nam


I've just tried the resin snapshot and the fatal error is no longer generated, it looks like the changes you made have resolved the issue.

Thanks once again for your efforts.

best regards

Gord
Reply With Quote
  #10  
Old 03-27-2013, 08:29 PM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

Great! Thanks for the feedback.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:30 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.