php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #19196 Explanation of "magic constants" not included in documentation
Submitted: 2002-08-30 07:58 UTC Modified: 2003-01-18 00:44 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: kmartin at db dot erau dot edu Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.0 OS:
Private report: No CVE-ID: None
 [2002-08-30 07:58 UTC] kmartin at db dot erau dot edu
This bug report has little to do with the implementation of PHP itself.  This is about the documentation for the language.

I was having a very hard time finding information about the so-called "magic constants", namely __FILE__ and __LINE__.
 
    Apparently, the use of these constants is very common.  The problem is, throughout the entire PHP.net web site, there is only one reference made to these "magic constants", and their mention is not very informative at all.  See this page: http://www.php.net/manual/en/language.constants.php
 
    The only other references to "__FILE__" I could find, using Google on the PHP.net site, were in user comments, and they were only used in examples, so there was no clear definition of the use of these constants.
 
    After searching the web for any sort of definition for the magic constants, I finally found one at this page:  http://www.sunsite.ualberta.ca/Documentation/Misc/php-3.0.15/language.constants.html
 
    In any case, the reason I was writing is because I just thought it would be a good idea to include a definition of this sort somewhere in the online documentation of PHP.  If it is included somewhere that I haven't looked or wasn't able to find, then I apologize for the intrusion.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-16 18:47 UTC] philip@php.net
On a related note, the new __CLASS__ and __FUNCTION__ constants should be documented with these too.  These four magical "constants" are also listed here:
  
  http://www.php.net/manual/en/reserved.php

(__CLASS__ and __FUNCTION__ were added in 4.3.0)
 [2003-01-18 00:44 UTC] philip@php.net
These have now been documented:
http://cvs.php.net/cvs.php/phpdoc/en/language/constants.xml

Thanks for the report :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 11 01:01:28 2024 UTC