Usage of PHP Magic Constants

__LINE__

<?php
echo __LINE__;
?>

The current line number of the file.

__FILE__

<?php
echo __FILE__;
?>

The full path and filename of the file. If used inside an include, the name of the included file is returned. Since PHP 4.0.2, __FILE__ always contains an absolute path with symlinks resolved whereas in older versions it contained relative path under some circumstances.

__DIR__

<?php
echo __DIR__;
?>

The directory of the file. If used inside an include, the directory of the included file is returned. This is equivalent to dirname(__FILE__). This directory name does not have a trailing slash unless it is the root directory. (Added in PHP 5.3.0.)

__FUNCTION__

<?php
function testFunction () {
    echo "Majolee InfoTech called by  function:- " . __FUNCTION__;
}
testFunction();
?>

The function name. (Added in PHP 4.3.0) As of PHP 5 this constant returns the function name as it was declared (case-sensitive). In PHP 4 its value is always lowercased.


Read previous post:
Free Javascript Obfuscator

Protects JavaScript code from stealing and shrinks size Free Javascript Obfuscator is a professional tool for obfuscation of javascript. It...

Close