Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Pessoa {
- private $dados = array();
- public function __set($nome, $valor){
- $this->dados[$nome] = $valor;
- }
- public function __get($nome){
- return $this->dados[$nome];
- }
- public function __tostring(){
- return "Tentei imprimir o objeto";
- }
- public function __invoke(){
- return "Objeto como função";
- }
- }
- $pessoa = new Pessoa();
- echo $pessoa();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement