1
I don’t quite understand what $this "gets".
In this case we have a code like this, for example:
<?php
class Teste {
public $testando;
public function VamosTestar(){
this->$testando = false;
}
}
In the case there, $this is "replacing" what? The test class? If I do so, it will be the same thing?
<?php
class Teste {
public $testando;
public function VamosTestar(){
Teste->testando = false;
}
}
In this case, I don’t think so, you put an error in my Netbeans IDE. But what I would use if I didn’t want to use $this?
The correct is
$this->testando = false;
, o this refers to the class in this example.– Gabriel Rodrigues
Edited, lack of attention from me. But for example, if I don’t want to use "$this" I can use the class name? How?
– Lucas de Carvalho
For the record, this
Teste->testando = false;
does not work, must understand first what is an "instantiated class" and what is "a class" ;)– Guilherme Nascimento
That I am in doubt, William, thank you for answering, I will be able to research.
– Lucas de Carvalho
@Lucascarvalho of a look What is the difference between a class and an object?
– Guilherme Nascimento