Re: Re: Question about C++ like macros on PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well I know, I wanted to know if any1 did find a workaround...

Barry wrote:
Andrei wrote:

Hi list,

For debugging purposes I want to send to a function the line and file where it is called. The problem is that I want these parameters to be added to function as default parameters (changing all function calls would not be an option for me)

function my_func( $param, $line = __LINE__, $file = __FILE__ )
{
   ...
}

won't work as it always gets the file and line where function is defined.
Also I don't want to change all function calls to put __LINE__ and __FILE__ parameters. I looked into assert too, but I have to change again all function calls to be assert( "my_func(...)" ); which again will be a pain in the a... as this function is often called in every scripts...

    Any1 has any ideea about it?

Thnx,
Andrei

Not possible.
__FILE__ and __LINE__ refers always to the line and File where the parser is at.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux