Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Pessoa {
- const nome = "maria";
- public function exibirNome(){
- echo self::nome;
- }
- }
- class Maria extends Pessoa{
- const nome = "jurema";
- public function exibirNome(){
- echo parent::nome;
- }
- }
- $maria = new Maria();
- $maria->exibirNome();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement