object vs functions

From: Date: Sat, 28 Dec 2002 02:18:04 +0000
Subject: object vs functions
Groups: php.general 
Request: Send a blank email to php-general+get-129484@lists.php.net to get a copy of this message
if i have a php script containing some functions, then all i have to do is include() the file and then call the functions. if i had an object (taking the example from php.net): <?php class foo { function do_foo() { echo "Doing foo."; } } $bar = new foo; $bar->do_foo(); ?> what is the point of having the object, when i could just call the functions? what are the uses of objects over functions/groups of functions? sorry if this is an innane or frequently asked question. -- Mat Harris OpenGPG Public Key ID: C37D57D9 mat.harris@genestate.com www.genestate.com

« previous php.general (#129484) next »