On Fri, 19 Jan 2001, James McLaughlin wrote:

> I get an error when doing this....
> 
> class Something
> {
>     var $something;
> 
>     function Something($this->something)
>     {
>         More somethings
>     }
> 
> }
> 
> The error tells me that I need a ")" in the line the function call is
> in.  If I take the "$this->something" it will parse fine.  Can you not
> do this?

No, you can't do this.  Functions within the class can automatically get
to class variables with $this->something, so passing them as parameters
would be somewhat redundant.

class Something
{
   var $something;

   function Something()
   {
      $this->something = "More somethings";
   }
}

Matt


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to