Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // clone*
- // construct*
- // invoke
- // tostring
- // get
- // set
- 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