Re: [PHP] Passing constructor values to functions in a class

From: David Otton (phpmail_at_jawbone.freeserve.co.uk)
Date: 10/31/03


To: php-general@lists.php.net
Date: Fri, 31 Oct 2003 04:03:43 +0000

On Fri, 31 Oct 2003 11:38:47 +0800, you wrote:

>I've been struggling with this for some time now and can't for the life of
>me figure out why the output is "GeorgeGeorge" and not "GeorgeBush"

> $this->$staff_name="George";

Try this instead

> $this->staff_name="George";

(superfluous $). Same goes for the other 3 instances. Sometimes it just
takes a fresh pair of eyes.

If you had your error reporting level set to E_ALL, you would have got a
(somewhat cryptic) notice.



Relevant Pages