note 37637 deleted from language.constants.predefined by didou
| From: | didou@php.net | Date: | Fri, 21 Nov 2003 16:57:50 +0000 |
| Subject: | note 37637 deleted from language.constants.predefined by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-60758@lists.php.net to get a copy of this message | ||
Note Submitter: sam at readinga hyphen z dot com
----
It should be noted for clarity that __LINE__ and __FILE__ are not strings. $__LINE__ and $__FILE__
will not give you a desired result.
<?
echo( $__LINE__ ); //doesn't work
echo( "$__LINE__" ); //doesn't work
echo( "__LINE__" ); //doesn't work
$line = __LINE__; //works properly, now $line is a string containing the line it was assigned on
echo( __LINE__ ); //Works properly
$line =& __LINE__; //doens't works
//You probably want you code to look like:
$string = "Error on line: ".__LINE__." in file: ".__FILE__." error code:
$err_code";
?>
I have seen <form action="<? echo( $__FILE__ ) ?>" >
This only works because when it is parsed the form action is blank ( action="" ) and the
default action is to use the current page! You don't want to echo __FILE__ anyway because that
would be like "/home/me/web/php/source/file.php"