note 37637 added to language.constants.predefined

From: Date: Fri, 21 Nov 2003 16:11:02 +0000
Subject: note 37637 added to language.constants.predefined
Groups: php.notes 
Request: Send a blank email to php-notes+get-60757@lists.php.net to get a copy of this message
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" ---- Manual Page -- http://www.php.net/manual/en/language.constants.predefined.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37637 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37637&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37637&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#60757) next »