#23403 [Com]: Negative integer default value becoming zero

From: Date: Fri, 02 May 2003 03:04:30 +0000
Subject: #23403 [Com]: Negative integer default value becoming zero
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38930@lists.php.net to get a copy of this message
ID: 23403 Comment by: yzcai at ustc dot edu Reported By: php at bicou dot com Status: Bogus Bug Type: Class/Object related Operating System: Win32 PHP Version: 4.3.2RC2 New Comment: well,i've got the lastest stable package from snaps.php.net and the problem has been fixed.yeah,not bug now. Previous Comments: ------------------------------------------------------------------------ [2003-05-01 21:52:01] yzcai at ustc dot edu A function with negative integer default value would have the same problem. <?php function test($var = -1) { echo $var; } test(); ?> And the output is 0. not bug? ------------------------------------------------------------------------ [2003-04-29 10:37:24] wez@php.net Possibly related to #23395, which has just been fixed. ------------------------------------------------------------------------ [2003-04-29 10:34:34] sniper@php.net You must have done something wrong, that works just fine here. Not bug. ------------------------------------------------------------------------ [2003-04-29 07:03:33] php at bicou dot com Property with a negative integer default value is not correctly initialized : <?php class TestNeg { var $v = -10; } $tn = new TestNeg; echo $tn->v; ?> outputs '0' instead of '-10' ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23403&edit=1

« previous php.bugs (#38930) next »