Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.8.7

Bug #11942 setData creates an error even when it isn't raised
Submitted: 2007-08-30 14:25 UTC
From: knipil Assigned: jmcastagnetto
Status: Closed Package: Math_Matrix (version 0.8.0)
PHP Version: 5.1.6 OS: Gentoo
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 27 + 37 = ?

 
 [2007-08-30 14:25 UTC] knipil (Emil Hernvall)
Description: ------------ In the setData method PEAR::raiseError is called even if an error doesn't occur. When a lot of matrix objects are instantiated (in my case during image analysis) theese objects stay in memory and causes php to run out of ram. This is easily corrected by changing: $errorObj = PEAR::raiseError('Invalid data, cannot create/modify matrix'); if (!is_array($data) || !is_array($data[0])) { return $errorObj; } To: if (!is_array($data) || !is_array($data[0])) { $errorObj = PEAR::raiseError('Invalid data, cannot create/modify matrix'); return $errorObj; } Test script: --------------- <?php require 'Math/Matrix.php'; for ($i = 0; $i < 1000000; $i++) { $m = new Math_Matrix(array(array(1))); }

Comments

 [2007-11-19 07:07 UTC] jmcastagnetto (Jesus M. Castagnetto)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.