Help with classes (oop)
| From: | Leonard Burton | Date: | Mon, 03 Feb 2003 19:27:36 +0000 |
| Subject: | Help with classes (oop) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-134166@lists.php.net to get a copy of this message | ||
Greetings,
I am trying to figure out using classes. I have read and read and read
about them but still cannot figure them new fangled things out. Could
someone please alter this snippet just a bit so it would be a correct test
script with a call to it?
When I run the script I get this in my browser <<
Warning: Missing argument 1 for first() in /usr/~~~~~~~~~~~~~index.php on
line 8
Warning: Missing argument 2 for first() in /usr/~~~~~~~~~~~~~~~~~/index.php
on line 8
35chris
>>
As you see it does print the output. What am I doing wrong?
Thanks,
Leonard
lbburt0@pop.uky.edu
<? php;
class first
{
var $age;
var $name;
function first($age, $name)
{
return $age.$name;
}
}
//main script
$first = new first;
$test=$first->first(35, "chris");
print $test;