Re: Classes or functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux