Edit report at http://pear.php.net/bugs/bug.php?id=18510&edit=1
ID: 18510
Updated by: [email protected]
Reported By: platts dot rich at gmail dot com
Summary: Reference issue -- PHP 5.3.4
Status: Closed
Type: Bug
Package: Math_Fraction
Operating System: OS X
Package Version: 0.4.1
PHP Version: 5.3.6
Assigned To: kouber
Roadmap Versions:
New Comment:
As to the "removal of /1" part in your code, you can use the following
code instead:
if ($p->getDen() == 1) {
$printamount = (int) $p->toString();
}
It will right trim starting from the first non-int character, i.e.
effectively removing the denominator part of the fraction.
Previous Comments:
------------------------------------------------------------------------
[2011-06-14 22:00:33] kouber
-Status: Analyzed
+Status: Closed
This bug has been fixed in SVN.
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.
------------------------------------------------------------------------
[2011-05-09 09:02:46] kouber
-Status: Open
+Status: Analyzed
-Assigned To:
+Assigned To: kouber
------------------------------------------------------------------------
[2011-05-06 20:16:45] mrplatts
Description:
------------
I'm getting an error back whenever I try to use the simplify
function in MathFraction 0.4.1 (beta)
Notice: Only variable references should be returned by
reference in /usr/lib/php/Math/FractionOp.php on line 267
It only happens when my original was a fraction (1/4 or 1/2) I
converted my whole numbers to fractions and added them
together before doing any math on them
Test script:
---------------
http://www.copypastecode.com/70489/
Expected result:
----------------
1: 1 cup flour
2: 3/2 cup ox tails
3: 7/2 cups newts brains
4: 2 tsp. eye of toad extract
Actual result:
--------------
Notice: Only variable references should be returned by
reference in /usr/lib/php/Math/FractionOp.php on line 297
1: 1 cup flour
Notice: Only variable references should be returned by
reference in /usr/lib/php/Math/FractionOp.php on line 297
2: 3/2 cup ox tails
Notice: Only variable references should be returned by
reference in /usr/lib/php/Math/FractionOp.php on line 297
3: 7/2 cups newts brains
4: 2 tsp. eye of toad extract
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18510&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.