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

Bug #1028 wrong assumption of unary minus if it's preceded with space(s)
Submitted: 2004-03-17 02:58 UTC
From: weirdan at mail dot od dot ua Assigned: mszczytowski
Status: Closed Package: Math_RPN
PHP Version: Irrelevant OS: Irrelevant
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 : 3 + 27 = ?

 
 [2004-03-17 02:58 UTC] weirdan at mail dot od dot ua
Description: ------------ if the '-' operator is preceded with space(s) it's assumed to be unary minus for the following operand Reproduce code: --------------- $inputString="2 - 1";//note the spaces include "RPN.php"; $rpn=new Math_RPN; $rpn->calculate($inputString,'deg',false); var_dump($rpn->getInputArray()); var_dump($rpn->getRpnArray()); Expected result: ---------------- expected output: array(3) { [0]=> string(1) "2" [1]=> string(1) "-" [2]=> string(1) "1" } array(3) { [0]=> string(1) "2" [1]=> string(1) "1" [2]=> string(1) "-" } Actual result: -------------- actual output: error: Syntax error array(4) { [0]=> string(1) "2" [1]=> string(2) "-1" [2]=> string(1) "*" [3]=> string(1) "1" } array(4) { [0]=> string(1) "2" [1]=> string(2) "-1" [2]=> string(1) "1" [3]=> string(1) "*" }

Comments

 [2004-07-11 22:35 UTC] gurugeek
Dear Maintainer, Your package math_rpn has currently 1 open bug. We urge you to take the necessary steps to solve the reported issues at your soonest convenience. If the bug issue hasn’t been addressed yet you are kindly asked to take the necessary steps to ensure a prompt resolution of the problem. If you already addressed the reported problem feel free to change the bug status as soon as possible. Regards David Costa PEAR Quality Assurance pear-qa@lists.php.net
 [2004-07-12 20:16 UTC] mszczytowski
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. Bug has been fixed in 1.1 release.