Bug #16479: var declaration in class has no meaning?
| From: | vdhome at idas dot cz | Date: | Sun, 07 Apr 2002 22:31:56 +0000 |
| Subject: | Bug #16479: var declaration in class has no meaning? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-4294@lists.php.net to get a copy of this message | ||
From: vdhome@idas.cz
Operating system: Win98SE
PHP version: 4.0.6
PHP Bug Type: Class/Object related
Bug description: var declaration in class has no meaning?
I am not sure whether this is a bug, a feature, or lack of a feature.
Perhaps this should be marked a "Feature Request" then... Anyway, here
goes: the var declaration in a class seems to have no meaning whatsoever,
except perhaps for documentation purposes. PHP allows me to assign to
class variables that weren't declared without even a warning at the
highest warning reporting level. That's actually not very surprising since
PHP doesn't otherwise have declarations of variables, but what is then the
meaning of var in classes?
I suggest that PHP should at least warn about class variables that weren't
declared.
--
Edit bug report at http://bugs.php.net/?id=16479&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16479&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16479&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16479&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16479&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16479&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16479&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16479&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16479&r=submittedtwice