#23522 [Opn]: Negative valus in variable declaration in classes

From: Date: Wed, 07 May 2003 08:58:16 +0000
Subject: #23522 [Opn]: Negative valus in variable declaration in classes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39210@lists.php.net to get a copy of this message
ID: 23522 Updated by: moriyoshi@php.net Reported By: wima at tiscali dot ch Status: Open Bug Type: Unknown/Other Function Operating System: Windows XP Professional PHP Version: 4.3.2RC2 New Comment: I got the correct result (-1) with the supplied script.. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#39210) next »