Another thing...
if the $lineno variable isn't defined yet, maybe the parser first try a cast
into __LINE__ type, so even if the assign procedure is called at the
function call, the line is evaluated at the funcion definition step...

but maybe it's a bullship :-)
J
"Dav" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Well, I don't know either but I was thinking about that...
> Usually this "$lineno = __LINE__" would be avaluated when the function is
> called, this mean it gives the __LINE__ of the function call itself.
> Why don't you try a more simple "include"/require instead of calling a
> funcion ?(see example)
> but maybe it will return the value "LINE 1" in the included file... I
don't
> know...
>
> that is:
>
> ...code...
> include("line.php");
> ...code...
>
> line.php
> --------
> echo(__LINE__);
> "Jason G." <[EMAIL PROTECTED]> ha scritto nel messaggio
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hello,
> >
> > Does anyone know of a way, that from within a function, you can
determine
> > what line number and file the function was called on?
> >
> > I did try:
> > function myfunc($lineno = __LINE__)
> > {
> > echo $lineno;
> > }
> > but this just outputted the very line that __LINE__ resides on.
> >
> > This would be very helpful in displaying sensible error messages, like
the
> > native php functions do.
> >
> > Thanks,
> >
> > -Jason Garber
> > IonZoft.com
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to