Considere o código em linguagem PHP apresentado abaixo.
1. <?php
2. class c1
3. {
4. public $a,$b;
5. function __construct($a,$b)
6. {
7. $this->a = $a;
8. $this->b = $b;
9. }
10. function __tostring()
11. {
12. return $this->b;
13. }
14. }
15. $x = new c1("IF","SUL");
16. echo $x.$x->a;
17. ?>
2. class c1
3. {
4. public $a,$b;
5. function __construct($a,$b)
6. {
7. $this->a = $a;
8. $this->b = $b;
9. }
10. function __tostring()
11. {
12. return $this->b;
13. }
14. }
15. $x = new c1("IF","SUL");
16. echo $x.$x->a;
17. ?>
O que será impresso por este código-fonte, considerando o comando echo da linha 16?
Provas
Questão presente nas seguintes provas