Posted by Oliver Grδtz on 10/22/05 14:45
I'd say it depends on the size of your project and on any plans to reuse
the code. Classes are better suited for building libraries of code you
use in other projects. And any large project runs into problems with
function names if the programmer doesn't use a rigorous naming system
(like "function package_subpackage_functionname() { ... }") and if such
names are used one could just as good use classes.
Technical difference: Functions are a little bit faster (think of PHP
having to look just one time instead of one time for findeing the class
and one time for finding the method).
Depending on PHP version: PHP4 has an affinity to using functions
because the classes are not as mature and full-featured as in PHP5.
So: with PHP4, you actively have to choose using classes;
with PHP5, you want to use classes.
OLLi
Navigation:
[Reply to this message]
|