Created
August 7, 2008 20:58
-
-
Save pedrolopesme/4495 to your computer and use it in GitHub Desktop.
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 | |
class OlaMundo{ | |
static $nomeDoUsuario; | |
/** | |
* Cria instancias automaticamente | |
* | |
* @author Chuck Norris. | |
*/ | |
static function novoOlaMundo(){ | |
return new OlaMundo(); | |
} | |
/** | |
* Escreve Ola Mundo | |
* | |
* @author Chuck Norris. | |
*/ | |
function imprime(){ | |
echo( "Ola Mundo e ola " . self::$nomeDoUsuario . PHP_EOL ); | |
} | |
} | |
OlaMundo::$nomeDoUsuario = "Pedro Mendes"; | |
$meuOlaMundo = OlaMundo::novoOlaMundo(); | |
$meuOlaMundo->imprime(); | |
$seuOlaMundo = OlaMundo::novoOlaMundo(); | |
$seuOlaMundo->imprime(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment