Answer the question
In order to leave comments, you need to log in
What is this (new someClass($_POST));?
I noticed the following code in one project: (new someClass($_POST)); ?
do we just create an object without assigning it to any variable? In theory, we only need the __construct function to work.
what is this approach called or what to read on the topic? where else is something like this used?
Answer the question
In order to leave comments, you need to log in
Most likely, the variable is passed to the constructor by reference, and how it is processed.
Bad option.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question