functions vs methods

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kickeru
Forum Newbie
Posts: 2
Joined: Tue Sep 22, 2009 4:30 am

functions vs methods

Post by kickeru »

hi,

in php is there a difference between a function and a method?

i know in java they are called methods and in c++ called functions.
in php i saw both terms used.
i was wondering are they just synonyms or does each have a slightly different meaning?
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: functions vs methods

Post by Mark Baker »

A method is a function that is encapsulated within a class
Post Reply