Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Teste
- {
- private $nome;
- public function add($nome) {
- return $this->nome = $nome;
- }
- public function exec() {
- $this->data($this->add($this->nome));
- }
- private function data($funcao) {
- $dados[] = $funcao;
- foreach($dados as $dado) {
- echo $dado;
- }
- }
- }
- $teste = new Teste;
- $teste->add("pereira");
- $teste->add("souza");
- $teste->add("silva");
- $teste->exec();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement