Functions using inside class and without the class, both have similar levels of work for small projects. Then why do professionals suggests to use classes instead of using simple direct function in PHP?
Asked
Active
Viewed 89 times
-1
-
2Take a look at this: http://stackoverflow.com/questions/2122123/when-to-use-a-class-vs-function-in-php – Remco K. May 15 '17 at 09:42
-
It is well described here http://stackoverflow.com/questions/2392795/functions-php-vs-oop – Danish Hakim Khan May 15 '17 at 10:17
1 Answers
0
functions/methods in OOP can have access to properties defined in their class, while procedural function just have access to global valuables and their own local variables, I think that's more precise?

Sulaiman Adewale
- 112
- 4