#21008 [NEW]: When initialising an undeclared instance variable no error is shown

From: Date: Sat, 14 Dec 2002 12:03:29 +0000
Subject: #21008 [NEW]: When initialising an undeclared instance variable no error is shown
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-27690@lists.php.net to get a copy of this message
From: jan_willem_maarse@hotmail.com Operating system: Linux PHP version: 4.2.3 PHP Bug Type: Scripting Engine problem Bug description: When initialising an undeclared instance variable no error is shown When I call a method that initializes a instance variable that isn't declared, php doen's complain. I see this as a bug, because when I mis-spelled an instance variabele some strange things happen. Because when I trie to get the value of an instance variabele, I get the old/unitialized value. Here is some sample code: <? class apple { var $color; function fruit($new_color) { $this->color = $new_color; } function set_taste($new_taste) { $this->taste = $new_taste; } } $green_apple = new apple('green'); $green_apple->set_taste('good'); ?> -- Edit bug report at http://bugs.php.net/?id=21008&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21008&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21008&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21008&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21008&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21008&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21008&r=support Expected behavior: http://bugs.php.net/fix.php?id=21008&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21008&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21008&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21008&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21008&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21008&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21008&r=isapi

« previous php.bugs (#27690) next »