note 63231 rejected from language.oop5 by betz
| From: | betz@php.net | Date: | Thu, 16 Mar 2006 16:17:21 +0000 |
| Subject: | note 63231 rejected from language.oop5 by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-105936@lists.php.net to get a copy of this message | ||
Note Submitter: jacques dot Guizol at lidil dot univ-mrs dot fr
----
I just tried the following program :
class Visitor{
public $name;
private $passwd;
public function __construct($name,$passwd){
$this->name = $name;
$this->passwd=$passwd;
}
public function getPas(){ // only in order to control the modification
return $this->passwd;
}
}
$Visit=new Visitor("John","dshfkjqh");
$Visit->__construct("Bob","aaaa");
print($Visit->name."\n");
print($Visit->getPas()."\n");
The result is :
Bob
aaaa (!!!!!!!)
So through an acces to the "public function" __construct, one can modify a private value !
I'm surprised ! and you ?