Re: PHP 4.3.11, question about classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/22/06, Michael Hulse <micky@xxxxxxxxxxxxx> wrote:
> Hi Chris! Thanks for all the great answers, I really appreciate all of
> your help. I am browsing the link you gave me now.
>
> I only have one question:
>
> On Mar 22, 2006, at 4:09 AM, chris smith wrote:
> > You're calling a method (which is a function inside a class). You
> > can't call a regular function without the brackets, so methods should
> > be the same.
>
> ...
>
> > class testing {
> >         var $what;
> > }
> >
> > $linkGenClass = new testing();
> > $linkGenClass->what = 'hi';
> > echo $linkGenClass->what;
>
> Let me see if I have this straight: "class testing {}" is a method, and
> "$linkGenClass = new testing();" is the class...

class testing {
}

is the class.

$linkGenClass = new testing();

creates an object.


functions inside the class:

class testing {
  function a() {
   echo 'inside method a';
  }
}

are methods.

> I am pretty familiar with PHP functions... I was under the assumption
> that "class testing{}" was the class, and any functions inside that
> class were the methods?

That's right.

Sorry for the confusion :)

--
Postgresql & php tutorials
http://www.designmagick.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux