They do not need to exist. At all.
You already have the data passed in as arguments. There is no need to save those arguments anywhere because those arguments are only useful until the functions...
Type: Posts; User: Elysia
They do not need to exist. At all.
You already have the data passed in as arguments. There is no need to save those arguments anywhere because those arguments are only useful until the functions...
Read and write data does not need to be persistent because their usefulability ends when the function ends.
Think about like this:
Separate variables into three groups:
- Local variables: define these inside the functions in the class as usual.
- Stateful variables (i.e. variables whose values you need...