Re: [PHP] Passing constructor values to functions in a class
From: Curt Zirzow (php-general_at_zirzow.dyndns.org)
Date: 10/31/03
- Next message: Christian Patterer: "After posting a form no access to fields neither via globals nor $_GET, $_POST etc"
- Previous message: David Otton: "Re: [PHP] Passing constructor values to functions in a class"
- In reply to: Terence: "Passing constructor values to functions in a class"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 04:05:30 +0000 To: php-general@lists.php.net
* Thus wrote Terence (terence@sunway.edu.my):
> Dear List,
>
> 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"
>
> <?php
> class StaffDetails {
>
> var $staff_name;
> var $staff_surname;
>
> function StaffDetails() {
>
> $this->$staff_name="George";
syntax is:
$this->staff_name="George";
(note: no $ before the class variable)
Curt
--
"My PHP key is worn out"
PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/
- Next message: Christian Patterer: "After posting a form no access to fields neither via globals nor $_GET, $_POST etc"
- Previous message: David Otton: "Re: [PHP] Passing constructor values to functions in a class"
- In reply to: Terence: "Passing constructor values to functions in a class"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]