PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Well , this is a small script , i just want to get line number and file which this function is called from .
Of couse , using Debug backtrace will make life easier
Well , this is a small script , i just want to get line number and file which this function is called from .
Of couse , using Debug backtrace will make life easier
function f($l = __LINE__,$f = __FILE__)
{
//want to do something here
}
$l and $f will become the line and filename where it is called , but i was wrong (as you can see)
Yep, because where __LINE__ and __FILE__ are parsed they will just the the same as the info for the part of the file you put them at They don't change when they get used, they are fixed values