#23522 [Opn->Csd]: Negative valus in variable declaration in classes
| From: | wez@php.net | Date: | Wed, 07 May 2003 10:56:54 +0000 |
| Subject: | #23522 [Opn->Csd]: Negative valus in variable declaration in classes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39222@lists.php.net to get a copy of this message | ||
ID: 23522
Updated by: wez@php.net
Reported By: wima at tiscali dot ch
-Status: Open
+Status: Closed
Bug Type: Unknown/Other Function
Operating System: Windows XP Professional
PHP Version: 4.3.2RC2
New Comment:
Already fixed in CVS; try a snapshot from http://snaps.php.net
Previous Comments:
------------------------------------------------------------------------
[2003-05-07 04:24:18] wima at tiscali dot ch
Hm... I ever get 0. This is a mysteriously Bug...
------------------------------------------------------------------------
[2003-05-07 03:58:15] moriyoshi@php.net
I got the correct result (-1) with the supplied script..
------------------------------------------------------------------------
[2003-05-07 00:44:39] wima at tiscali dot ch
Hello
This script does output 0 instead of -1. If I initialize the variable a
in the constructor (the commented line) the output is correct. I'm not
shure if it is a bug, but if I initialize the variable with a positive
value it works correct.
Thanks for fixing this bug.
Marco
<?
$a = new myClass;
class myClass {
var $a = -1;
function myClass() {
//$this->a = -1;
echo $this->a;
}
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23522&edit=1