Results 1 to 7 of 7
Thread: PHP classes tutorial?
-
08-04-2007, 12:57 PM #1Web Hosting Guru
- Join Date
- Dec 2005
- Posts
- 326
PHP classes tutorial?
Hi,
I know how to do classes and all that, I did a Java class in College last year... however what I want to know is how to do some advanced classes, or good ideas/examples on how I can speed up my development that much more with classes.
Also what do you guys use your classes for?
-
08-04-2007, 01:46 PM #2Junior Guru
- Join Date
- Mar 2005
- Posts
- 246
I guess it depends on what you consider 'advanced' classes.
The way I learned was downloading a MySQL class, working with it and developing a script that I needed. Taking other peoples work and learning from it is the best way when you don't have a class to go to.ColoCrossing - Connecting Business
█ Alex Vial | avial@colocrossing.com | 1.800.518.9716
█ Enterprise-Class Colo & Dedicated Servers in BUF, CHI, DFW, NYC, SJC, ATL & SEA
-
08-04-2007, 02:41 PM #3Web Hosting Master
- Join Date
- Jan 2006
- Location
- Athens, Greece
- Posts
- 1,481
Grab a C book for oop. Learn about inheritance and abstraction. For me classes are not much suitable for web development, they tend to slow down overall execution time too.
-
08-04-2007, 04:28 PM #4
The best place to take a look @ example php classes? http://www.phpclasses.org/ . You can download the classes, use them as examples, or whatever you like.
There are a variety of uses for classes, such as sql connection, mail, IM, etc. Take a look through the classes listed on that website and you'll see some pretty decent uses and ways to use php classes.Tom Whiting, WHMCS Guru extraordinaire
Linux problems? WHMCS Problems? Give me a shout
Check out my WHMCS Addons
-
08-04-2007, 05:47 PM #5Junior Guru
- Join Date
- Mar 2005
- Posts
- 246
ColoCrossing - Connecting Business
█ Alex Vial | avial@colocrossing.com | 1.800.518.9716
█ Enterprise-Class Colo & Dedicated Servers in BUF, CHI, DFW, NYC, SJC, ATL & SEA
-
08-04-2007, 08:10 PM #6Web Hosting Master
- Join Date
- Nov 2001
- Location
- Vancouver
- Posts
- 2,422
That's odd. Virtually every module I write is primary comprised of class definitions. I can't imagine *not* using classes. There are very few simple functions in my library; and of the few, many of these are used to construct a class instance.
Code:they tend to slow down overall execution time too.
Usually time to market is more important than execution time and rarely (if ever, at least in my experience) does the overhead introduced by using classes ever cause me to have second thoughts about a particular implementation. almost always algorithm, not class instantiation, is the root problem when performance is an issue.
Your mileage may vary.
Or perhaps Python is just faster.“Even those who arrange and design shrubberies are under
considerable economic stress at this period in history.”
-
08-07-2007, 06:22 PM #7Junior Guru Wannabe
- Join Date
- Jul 2007
- Posts
- 88
You might also take a look at the documentation on the php.net site which I have found to be a good resource though it might not be the best starting place. I know that as I have learned OOP I have had the greatest success just programming. When I got to certain points in my coding I began to understand the things that I had been reading about.
rootbsd.net :: BSD based hosting for smart people
FreeBSD VPS :: FreeBSD and OpenBSD Hosting Powered By Xen
IRC: #rootbsd on freenode
twitter: @rootbsd