Re: PHP 4.3.11, question about classes

From: Date: Wed, 22 Mar 2006 12:22:16 +0000
Subject: Re: PHP 4.3.11, question about classes
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-232408@lists.php.net to get a copy of this message
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... 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? An example function: function example() {} But, this would be considered a method?: class method {} Seems a bit confusing. Esp. when I construct the above method like so: "$myClass = new method();" Hehe, I am sure that link you sent will give me some great answers, reading now. I really appreciate your time/links/knowledge/help. :) Cheers, Micky

« previous php.general (#232408) next »