PHP _FUNCTION_ Constant with Example

Example _FUNCTION_

_FUNCTION_ Represents the function name where it is used. If it is used outside of any function, then it will return blank.
_METHOD_Represents the class name where it is used. If it is used outside of any function, then it will return blank.
_CLASS_Represents the name of the class method where it is used. The method name is returned as it was declared.

Result:

  Function of demo class : test
  Method of demo class : demo::testme
  Class : demo

php: _FILE_

Represents full path and file name of the file. If it is used inside an include, name of included file is returned.


Result:

Your file name :D:\SQLBD\htdocs\php\index.php

php _LINE_

The current line number of the file where it is used.

Example: _LINE_

Result:

The Line number : 3