LLLLLLL Posted September 19, 2010 Share Posted September 19, 2010 :'( I'm calling a function that resets a couple arrays: public function resetStuff() { $this->someArray = array(); $this->someOtherArray = array(); } However, someOtherArray is not resetting!! How could that be? I can add debug statements to echo the size of the arrays before and after the function calls. It shows that: someArray went from n to 0 someOtherArray went from n to n How is that possible?? Link to comment https://forums.phpfreaks.com/topic/213834-array-not-clearing-extremely-frustrating/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 19, 2010 Share Posted September 19, 2010 You most likely have a spelling error in the actual code. As always, in programming, if you want help with a problem in your actual code, you need to post the code that is actually exhibiting the problem. Also, are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON so that php would help you by reporting and displaying all the errors it detects? You will save a ton of time. Link to comment https://forums.phpfreaks.com/topic/213834-array-not-clearing-extremely-frustrating/#findComment-1112911 Share on other sites More sharing options...
LLLLLLL Posted September 19, 2010 Author Share Posted September 19, 2010 This was indeed helpful: error_reporting set to E_ALL and display_errors set to ON There was a typo in some OTHER code that caused downhill problems. Argh. Thanks for that info. Link to comment https://forums.phpfreaks.com/topic/213834-array-not-clearing-extremely-frustrating/#findComment-1112924 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.