Created
February 11, 2012 06:11
-
-
Save fabioluciano/1796983 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class PessoaJuridica extends Pessoa { | |
| protected $nome; | |
| public function __construct($nome) { | |
| $this->nome = $nome; | |
| } | |
| } | |
| $pessoajuridica = new PessoaJuridica('Coisa Inc.'); | |
| $pessoa = new Pessoa(); | |
| print $pessoa->contratar($pessoajuridica); | |
| /* | |
| Catchable fatal error: Argument 1 passed to Pessoa::contratar() must be an instance of PessoaFisica, instance of PessoaJuridica given | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment