ID:               42268
 User updated by:  donauinsel at hotmail dot com
 Reported By:      donauinsel at hotmail dot com
-Status:           Bogus
+Status:           Open
 Bug Type:         *General Issues
 Operating System: W32
 PHP Version:      5.2.4RC1
 New Comment:

Can you please explain why it works until latest PHP release but not in
5.2.3 ?!


Previous Comments:
------------------------------------------------------------------------

[2007-08-11 06:33:09] donauinsel at hotmail dot com

This works by example also when using references. So there is going
something wrong with php.

$prevmonth = ($month - 1);
$prevyear = ($year + 0);
$nextmonth = ($month + 1);
$nextyear = ($year + 0);

fixdate($prevmonth, $prevyear);
fixdate($nextmonth, $nextyear);

------------------------------------------------------------------------

[2007-08-11 04:21:34] donauinsel at hotmail dot com

Sorry i don't understand what you mean. I use the pass-by-reference
function with global variable.

------------------------------------------------------------------------

[2007-08-10 21:43:28] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.

------------------------------------------------------------------------

[2007-08-10 20:48:53] donauinsel at hotmail dot com

Description:
------------
Try first $month = 11,$year = 2007 then $month =12, $year = 2007
Function returns correct value which seems not to be passed correctly.

Reproduce code:
---------------
function fixdate(&$month, &$year) {
        if ($month < 1) {
                $month = 12;
                $year--;
        } elseif ($month > 12) {
                $month = 1;
                $year++;
        }
}

fixdate($nextmonth = ($month + 1), $nextyear = ($year + 0));



Expected result:
----------------
12 / 2007 or 01 / 2008 

Actual result:
--------------
you will get 13 / 2007 instead.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=42268&edit=1

Reply via email to