PHP Magic Constant examle - Phptpoint.com

PHP:Magic Constant

PHP Summer Training/Internship with 2 Live Projects in Noida Fee is only 5500/-Click here to Book Your Seat.

/ins>

PHP Magic Constant

There are a number of predefined constants available to your scripts.
We will use these constants as we need them; there’s a sample:

PHP: Magic Constant

PHP Magic Constant
__LINE__The current line number of the file.
__FILE__The full path and filename of the file.
__FUNCTION__The function name
__CLASS__The class name
__METHOD__The class method name
PHP_VERSIONThe PHP version
PHP_INT_MAXThe PHP integer value limit

__LINE__

The current line number of the file.

Output
The Line number : 2

__FILE__

The full path and filename of the file.

Output
Your file name : C:xampplitehtdocsmagic_constantfile.php

__FUNCTION__,     __CLASS__,     __METHOD__

The function name
The class name
The class method name

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

PHP_VERSION

The PHP version

Output
Current PHP Version you are using : 5.3.1

PHP_INT_MAX

The PHP integer value limit

Output
Integer Maximum Value : 2147483647

Latest Trending Technologies