+ 1
[PHP] Classes in function parameters
What does this do and how do I use it? class SomeClass {} function someFunction(SomeClass $someClass) {}
3 ответов
0
the code you posted will not do anything on its own. a class is used in object oriented programming and is used to generically describe a real world object. A function is used to group together a set of instructions. this example looks like it is calling a class inside of a function. Might be useful in some cases bit you really need to understand object oriented programming before it will make sense.
0
@billy I know, it was not meant to do anything. It was just to show what I meant by "classes in function parameters". I do understand OOP (or at least some of it), I just want to know how you can use classes in function parameters for
0
Sorry I guess I miss understood.