4.3.2RC2: mul_function() Change Kills -1 As Parameter Default?

php.internals

Michael Sisolak

23 years ago
For me with 4.3.2RC2 (Win32 build) this code no longer works as it should: function test($param = -1) { echo $param; } test(); Instead of printing -1, is prints 0 instead. I tracked this for a while through the code, and believe the problem is with the changes just introduced to mul_function() in zend_operators.c. I can't follow it well enough to explain why, but if I revert to the php_4_3_2RC1 version of mul_function() my test code works again. Michael Sisolak msisolak@gvpi.com __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com

Wez Furlong

23 years ago
Should be fixed already in CVS. --Wez. On Fri, 2 May 2003, Michael Sisolak wrote:

Michael Sisolak

23 years ago
Wez, Can you point me in the right direction of the fix? The most recent version of zend_operators.c is in 4.3.2RC2, so the fix must be in some other file. I've dug around, but I can't figure out where it would be. Michael --- Wez Furlong <wez@thebrainroom.com> wrote:
> Should be fixed already in CVS. > > --Wez. > > On Fri, 2 May 2003, Michael Sisolak wrote: > > > For me with 4.3.2RC2 (Win32 build) this code no longer works as it > > should: > > > > function test($param = -1) > > { > > echo $param; > > } > > test(); > > > > Instead of printing -1, is prints 0 instead. I tracked this for a > > while through the code, and believe the problem is with the changes > > just introduced to mul_function() in zend_operators.c. I can't > follow > > it well enough to explain why, but if I revert to the php_4_3_2RC1 > > version of mul_function() my test code works again. > > > > Michael Sisolak > > msisolak@gvpi.com
__________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com

Wez Furlong

23 years ago
zend_multiply.h contains the fixed macro definition. The problem was that the broken version incorrectly destroyed the return_value when determining if promotion to float was required, in the case that op1 == return_value. --Wez. On Fri, 2 May 2003, Michael Sisolak wrote:

Sascha Schumann

23 years ago
On Fri, 2 May 2003, Michael Sisolak wrote:
> Wez, > > Can you point me in the right direction of the fix? The most recent > version of zend_operators.c is in 4.3.2RC2, so the fix must be in some > other file. I've dug around, but I can't figure out where it would be.
Patch: http://cvs.php.net/diff.php/Zend/Attic/zend_multiply.h?sa=1&login=2&r1=1.1.2.3&r2=1.1.2.4&ty=u Run "make clean" before rebuilding PHP. - Sascha

Michael Sisolak

23 years ago
Sascha/Wez, Thanks for the quick help (that zend_multiply.h is a tricky file to find) - that patch fixed the issue I was seeing. Michael --- Sascha Schumann <sascha@schumann.cx> wrote:
> On Fri, 2 May 2003, Michael Sisolak wrote: > > > Wez, > > > > Can you point me in the right direction of the fix? The most > recent > > version of zend_operators.c is in 4.3.2RC2, so the fix must be in > some > > other file. I've dug around, but I can't figure out where it would > be. > > Patch: > > >
http://cvs.php.net/diff.php/Zend/Attic/zend_multiply.h?sa=1&login=2&r1=1.1.2.3&r2=1.1.2.4&ty=u
> > Run "make clean" before rebuilding PHP. > > - Sascha
__________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com

Unnamed Person

23 years ago
Hello, Wez has fixed this issue (at least on the *= operator). Please try snaps http://snaps.php.net and tell us if you still have this problem.
-- Regards. M.CHAILLAN Nicolas nicos@php.net www.WorldAKT.com Hébergement de sites internets. "Michael Sisolak" <msisolak@yahoo.com> a écrit dans le message news: 20030502170441.57583.qmail@web13405.mail.yahoo.com...