Re: Basics of OOP

From: Date: Tue, 09 Sep 2008 19:14:53 +0000
Subject: Re: Basics of OOP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-279746@lists.php.net to get a copy of this message
On Tue, 2008-09-09 at 20:09 +0100, Ben Stones wrote: > Hi, > > The following bit of code doesn't output anything: > > <?php > class output { > var $text; > function outputText() { > $this->text = "Hello World"; > echo $this->text; > } > } > > $class = new output(); > $class->outputText; Should be $class->outputText(); Same with other example. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP

« previous php.general (#279746) next »