ID:               21008
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Won\'t fix
 Bug Type:         Scripting Engine problem
 Operating System: Linux
 PHP Version:      4.2.3
 New Comment:

Not a bug at all, you don't need to declare any variable in PHP,
nowhere. Adding an error for this will break tons of scripts, so we're
not going to add it.


Previous Comments:
------------------------------------------------------------------------

[2002-12-14 06:03:29] [EMAIL PROTECTED]

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 this bug report at http://bugs.php.net/?id=21008&edit=1

Reply via email to