Created
October 1, 2015 21:08
-
-
Save unicodeveloper/4daef4fe9a6db24ff457 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 | |
namespace Busayo; | |
class MagicConstants | |
{ | |
public function getFile() | |
{ | |
return __FILE__; | |
} | |
public function getDirectory() | |
{ | |
return __DIR__; | |
} | |
public function getTrait() | |
{ | |
return __TRAIT__; | |
} | |
public function getNamespace() | |
{ | |
return __NAMESPACE__; | |
} | |
public function getLine() | |
{ | |
return __LINE__; | |
} | |
public function getMethod() | |
{ | |
return __METHOD__; | |
} | |
public function getClass() | |
{ | |
return __CLASS__; | |
} | |
public function getFunction() | |
{ | |
return __FUNCTION__; | |
} | |
} | |
$app = new MagicConstants; | |
echo $app->getFile(). PHP_EOL; | |
echo $app->getDirectory(). PHP_EOL; | |
echo $app->getTrait(). PHP_EOL; | |
echo $app->getNamespace(). PHP_EOL; | |
echo $app->getLine(). PHP_EOL; | |
echo $app->getMethod(). PHP_EOL; | |
echo $app->getClass(). PHP_EOL; | |
echo $app->getFunction(). PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment