In the context of the question would be the 2nd option:
$atleta = new Atleta();
But remember that in PHP, it is not necessary to use ()
parenthesis when the class has no constructor or the constructor does not need arguments.
So, that would also be true:
$atleta = new Atleta;
Explanation of each option
I do not know if I'm wrong, but the question looks very much like an evaluative question. So assuming this, I do not think it's cool just to "give the right answer," but to explain what each thing does.
$atleta = Atleta;
Generally, this syntax is used in PHP to get the value of a constant.
For example:
const Atleta = 'Atleta';
// ou
define('Atleta', 'Atleta');
$atleta = Atleta;
Note : When attempting to assign the value of an undefined constant, you will receive an error message of type E_NOTICE
and the value assigned will be a string as the name of the nonexistent constant. >
$atleta= Atleta();
This syntax above is used for the direct call of functions. Functions in PHP are called using the parenthesis, and you can pass arguments or not.
Example:
function Atleta() {
return 'Atleta';
}
$atleta = Atleta();