Re: using $this-> implicitly inside same class
| From: | Xuefer | Date: | Sat, 25 Feb 2006 02:46:25 +0000 |
| Subject: | Re: using $this-> implicitly inside same class | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-22010@lists.php.net to get a copy of this message | ||
>
>
> I was thinking of something more like this:
>
> <?php
>
> class Connection {
>
declare (implicit_this_properties) {
> // use $this-> implicitly within this class only
> ini_set('this.use_implicit', ON);
>
> protected $link;
> private $server, $username, $password, $db;
}
>
> public function __construct($server_p, $username_p, $password_p, $db_p)
> {
$key = 'server';
${$key} = $server_ip
> $server = $server_p;
now which is the $server? $this->server or local scope $server?
is they any side effect this "feature" make?
> $username = $username_p;
> $password = $password_p;
> $db = $db_p;
> connect();
> }
>
good idea but it's already proposed and rejected because php groups
don't like to make things complex.