On Wed, March 22, 2006 5:27 am, Michael Hulse wrote: > I am just learning about classes. > > My server is running PHP 4.3.11 > > Example code: > > class testing { > var $what; > } > > $linkGenClass = new testing(); > $linkGenClass->what = 'hi'; > echo $linkGenClass->what; > > Why does the constructor require the "()"? > > I have seen many examples via google that do not use "()". I dunno. May be version-dependant, or maybe because you didn't define __constructor nor function testing() as a contructor... Try adding a constructor function and see what happens. > Should I worry about capitalizing the first letter of the class? Try it and see. Most crucial is to be consistent. Second most crucial is to just do it the way everybody else does it. > Can class names have underscores? That's in the manual, but try it and see. > Are spaces allowed on either side of the "->"? In the manual, try it and see. > Is "var $what" PHP 4 and 5, whereas "public $what" is PHP 5? Yes. > Got any good links to class tutorials for PHP 4.3.11? info.com/PHP OOP tutorial -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php