ID:               4054
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         Other
 Operating System: Windows 95/98/NT
 PHP Version:      3.0.16
 New Comment:

you just descovered "variable variables"

http://www.php.net/manual/en/language.variables.variable.php


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

[2000-04-05 20:32:15] [EMAIL PROTECTED]

Have a look at this piece of code:

class User {
  var $Name;
  var $Mail

  function SetUser() {
    $this->$Name = "Bill";
    $this->$Mail = "[EMAIL PROTECTED]";
    echo $this->$Name, ":", $this->$Mail;
  }
}

Maybe you will notice the mistake with the $ sign ($this->$Name instead
of $this->Name, see bug report #60). But PHP doesn't print an error, it
interprets the code and outputs this:
[EMAIL PROTECTED]:[EMAIL PROTECTED]
So, either PHP should produce an error, or there should be a better
description of the missing $ sign in the "Classes and Objects" section
of the documentation.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=4054&edit=1

Reply via email to