In php, the magic constants _ FILE _, _ LINE _ ,__ FUNCTION _ are used. This article mainly describes the magic constants _ FILE _, _ LINE _ ,__ FUNCTION __. if you need them, you can refer to a simple and practical example. Name Description _ FILE _ current FILE name _ LI this article mainly describes the magic constants _ FILE _, _ LINE _ ,__ FUNCTION __, if you need it, you can refer to a simple and practical example.
Name
Description
_ FILE _
Current file name
_ LINE _
Current row number
_ FUNCTION _
Current function name
_ CLASS _
Current class name
_ METHOD _
Current method name
The so-called magic constant is not a real constant, but a variable that gets a fixed value based on the occasion.
| The code is as follows: |
|
|
Echo _ FILE __;
Echo'
';
Echo _ LINE __;
Echo'
';
Function funcTest ()
{
Echo _ FUNCTION __;
}
FuncTest ();
?>
Output
D: AppServwwwBasic7demo15. php
5
FuncTest |
Bytes. Name Description _ FILE _ current FILE name _ LI...