Sunday, March 3, 2013

Re: Hash.php



On Wednesday, 27 February 2013 19:45:29 UTC+1, CrotchFrog wrote:
(Cake 2.2.5) I recently started getting an error that reads:
Warning (2): Invalid argument supplied for foreach() [CORE]/Cake/Utility/Hash.php, Line 50]

Line 50 in Hash.php is part of get() function for the Hash class. Trying to debug anything in that function results in a memory allocation error. How is Hash being used and what kind of data is being presented to the function that it's running out of memory? 

The debugger class calls it - so if you put a debug statement in there, you're invoking a loop. Just use php debug methods like print_r(foo);  and you won't self-sabotage your efforts, OR alternatively log the whatever instead of using debug().

That said, all errors handled by CakePHP have a stack trace (or - since it's not obvious from the question, is the stack trace responsible for the loop? how?) so just look what is calling hash and specifically what is the second argument since it's not a string, not numeric and not an array. 

AD

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: