__LINE__, __FILE__ and function()

From: Date: Wed, 04 Sep 2002 15:03:42 +0000
Subject: __LINE__, __FILE__ and function()
Groups: php.dev 
Request: Send a blank email to php-dev+get-87909@lists.php.net to get a copy of this message
Hi all, Sorry if this isn't an interesting feature for anyone else, but it would prove to be very useful for me. In the following test case: <?php function output($line=__LINE__) { echo "Function called on line $line<br>"; } output(); output(); ?> The variable $line is calculated once as the start of the script (with $line always being "3") where as the desired effect would surely be for it to be calculated each time the function is called, with the output being "7" and "8" respectivly. Im guessing this is a feature of whatever handles the building / assigning of functions, but I really dont know the php / zend source well enough to say. How much work would one be looking at to alter this functionality? Are there any reasons why this hasnt already been done? Thanks again, -- Dan Hardiker [dhardiker@staff.firstcreative.net] ADAM Software & Systems Engineer First Creative Ltd

« previous php.dev (#87909) next »