note 47951 deleted from language.constants.predefined by sean

From: Date: Wed, 08 Dec 2004 22:24:09 +0000
Subject: note 47951 deleted from language.constants.predefined by sean
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-81552@lists.php.net to get a copy of this message
Note Submitter: x123 at bestof dash inter dot net ---- On my PHP Version 4.2.0RC2, when I define a function that uses __FILE__ in an include file and then call it in the main file, the filename of the include file is used. I don't know if this is a bug or a feature... but I think it would be more logical if - like for any other variable - the current value at time of execution would be used. <?php // this is file : include.php // ... session_register("login_ok") ... function foot() { die("\n<hr>last update: ".date("d.m.y",filemtime(__FILE__)). "</body></html>");} if (!$login_ok) if ($_POST['user']!="myUsername" or $_POST['pass']!='myPasswd') { display_login_form(); foot(); } $logged_in=1; ?> <?php // this is file : main.php @require("include.php"); display_main_menu(); foot(); ?> Unfortunately, at bottom of main.php appears the mod.time of "include.php". (and if I use getlastmod() in foot(), then the call to foot() inside include.php will display the mod.time of he main file.)

« previous php.notes (#81552) next »