Questions tagged [magic-constants]

PHP provides a number of 'magic constants' such as __LINE__, __FILE__, __FUNCTION__, __CLASS__ and __METHOD__. Use this tag with questions tagged [php] that ask about these, and any other, magic constants.

If your question is about PHP (so it has a tag) and is also intrinsically about one of the magic constants in PHP, then you can use this tag.

Examples of such magic constants include:

  • __LINE__
  • __FILE__
  • __FUNCTION__
  • __CLASS__
  • __METHOD__
  • __DIR__

Etc.

31 questions
0
votes
1 answer

PHP magic constants not working

When I input this PHP code, the magic constant _LINE_ just gets output literally. Output: This is line_LINE_ What am I doing wrong?
Nihal Sahu
  • 189
  • 1
  • 2
  • 13
1 2
3