Last active
October 27, 2015 17:32
-
-
Save edgarsandi/dd20b7310f7f1e22a3af to your computer and use it in GitHub Desktop.
multi-namespaces
This file contains 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 | |
namespace Rua; | |
class Mae | |
{ | |
public function darBronca() | |
{ | |
return 'mae dando bronca na rua' . PHP_EOL; | |
} | |
public function fazerCarinho() | |
{ | |
return 'mae fazendo carinho na rua' . PHP_EOL; | |
} | |
} | |
namespace Casa; | |
class Mae | |
{ | |
public function darBronca() | |
{ | |
return 'mae dando bronca em casa' . PHP_EOL; | |
} | |
public function fazerCarinho() | |
{ | |
return 'mae fazendo carinho em casa' . PHP_EOL; | |
} | |
} | |
echo (new \Rua\Mae())->darBronca(); | |
echo (new \Rua\Mae())->fazerCarinho(); | |
echo (new \Casa\Mae())->darBronca(); | |
echo (new \Casa\Mae())->fazerCarinho(); | |
######################################### | |
╭─edgarsandi@sake ~/proj/personal | |
╰─$ php multi-namespaces.php | |
mae dando bronca na rua | |
mae fazendo carinho na rua | |
mae dando bronca em casa | |
mae fazendo carinho em casa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment