Created
December 9, 2014 18:45
-
-
Save gmsantos/edb94ae700792dc8175c to your computer and use it in GitHub Desktop.
Constantes PHP
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 | |
define('FOO','Hello World');` |
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 testeConstant; | |
Class Foo { | |
public function exibeFoo(){ | |
echo \FOO; // Hello World | |
} | |
} |
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 | |
include_once("Configuracao.php"); | |
require_once('Foo.php'); | |
use testeConstant\Foo; | |
$foo = new Foo(); | |
$foo->exibeFoo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment