Re: PHP 4.3.11, question about classes

From: Date: Wed, 22 Mar 2006 12:33:21 +0000
Subject: Re: PHP 4.3.11, question about classes
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-232410@lists.php.net to get a copy of this message
On 3/22/06, Michael Hulse <micky@ambiguism.com> 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/

« previous php.general (#232410) next »