Jump to content

__LINE__ alternative


BrainPill
 Share

Recommended Posts

Hi there

I made a function for getting the location of an error.
The script where the error is, is done with $_SERVER['SCRIPT_FILENAME']
but when using __LINE__ I get the location of the script where the function
code is placed, not where the function is executed.

How can I solve this?

example:

 

		<?php 
		function find_file_linenum() {
		 
		 
		
		echo '<br><br>';
		echo $_SERVER['SCRIPT_FILENAME'];
		echo '<br><br>login/condition error at line : .... ';
		echo __LINE__;
		echo '<br><br>';
		
	} ?>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...