Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Pessoa {
- public function atribuirNome($nome){
- return "O nome da pessoa é: ".$nome;
- }
- }
- class Exibe {
- public $pessoa;
- public $nome;
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- function __construct($nome){
- $this->pessoa = new Pessoa();
- $this->nome = $nome;
- }
- public function exibeNome(){
- echo $this->pessoa->atribuirNome($this->nome);
- }
- }
- $exibeNome = new Exibe("Igor");
- $exibeNome->exibeNome();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement