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  


 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-07-12 20:16 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!