Greetings,
I have an all purpose variable dumper that uses Var_Dump to show me
data structures.
I have an application wide function that I simply call to dump a
structure:
vardump($var);
function vardump ($vars, $details = null) {
if ($vars == 'dump') {
if (isset($GLOBALS['vardump']) ) {
Var_Dump::display($GLOBALS['vardump'],'GLOBALS',VAR_DUMP_DISPLAY_MODE_HTML_TABLE);
}
}
if ( isset($details) ) {
$GLOBALS['vardump'][$details][] = $vars;
} else {
$GLOBALS['vardump'][] = $vars;
}
}
The function can also accept a second argument that lets dumps
information about who/what/where the variable is being dumped from.
Now, sometimes I'm dumping alot so I would like to know where exactly
the dump came from, like this:
vardump($rows, basename(__FILE__) .' <br> '. __LINE__ );
Now, I'd like to keep the vardump() call as clean as possible. Is there
anyway for the function vardump to know the __FILE__ and __LINE__
without being told in an argument?
Many thanks! 3 8814
"Zim" <27*******@sneakemail.com> wrote in message
news:cc********@odak26.prod.google.com... Greetings,
<snip> Now, sometimes I'm dumping alot so I would like to know where exactly the dump came from, like this:
vardump($rows, basename(__FILE__) .' <br> '. __LINE__ );
Now, I'd like to keep the vardump() call as clean as possible. Is there anyway for the function vardump to know the __FILE__ and __LINE__ without being told in an argument?
You, Sir, seek a stack trace. Such a thing does not exist. Google records
the following from 2002 in php.general:
"There is no native PHP function for getting a stack trace. This has been
discussed many times on the PHP-DEV mailing list. It has always been
discarded due to an unacceptable overhead that would be introduced into the
parsing process."
Sorry it's not better news.
Garp
"Garp" <ga***@no7.blueyonder.co.uk> emerged reluctantly from the
curtain and staggered drunkenly up to the mic. In a cracked and
slurred voice he muttered: You, Sir, seek a stack trace. Such a thing does not exist. Google records the following from 2002 in php.general:
Oh rrrreeeeallly?
*COUGH* http://uk.php.net/debug_backtrace *COUGH*
--
Phil Roberts | Without me its just aweso. | http://www.flatnet.net/
"Mankind differs from the animals only by a little,
and most people throw that away."
- Confucious
"Phil Roberts" <ph**********@googlemail.com> wrote in message
news:Xn*************************@216.196.97.132... "Garp" <ga***@no7.blueyonder.co.uk> emerged reluctantly from the curtain and staggered drunkenly up to the mic. In a cracked and slurred voice he muttered:
You, Sir, seek a stack trace. Such a thing does not exist. Google records the following from 2002 in php.general:
Oh rrrreeeeallly?
*COUGH* http://uk.php.net/debug_backtrace *COUGH*
God, when did that appear! >hugz< Ah, 4.3.0........ I predate that. Yay!
Garp This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David Abrahams |
last post by:
Is there any way to determine the file and line number (if any) of a
method's invocation from within its body?
Many Thanks in advance,
Dave
--
David Abrahams
Boost Consulting...
|
by: Jim Cobban |
last post by:
I am using Xerces to read an XML file and load it into a DOM so I can update
it and subsequently serialize the updated DOM.
The problem I have is that as I traverse the DOM I would like to inform...
|
by: Ken Varn |
last post by:
I want to be able to determine my current line, file, and function in my C#
application. I know that C++ has the __LINE__, __FUNCTION__, and __FILE___
macros for getting this, but I cannot find a...
|
by: BlueFox |
last post by:
Hi :
When i display the DataBase in System.Windows.Forms. DataGrid ,i want to
display the line number of ever line .How can i do it ?
Any help may be Good .
|
by: John Galt |
last post by:
I have a stacktrace that gives the line number of the offending code, but
for the life of me can't seem to find a display of the line number in the
Visual Studio.Net code editor. I'm sure I've seen...
|
by: Phil Jollans |
last post by:
Hi,
I have an error dialog which shows the stack trace, usually without line
numbers in the release version. To try to diagnose a particular problem, I
have provided a user with a debug version...
|
by: Mark Kamoski |
last post by:
Hi Everyone--
How can one get the line number of where an error was thrown and/or caught?
For example, note the following, for use at any given point in a piece of
code:
....to get the...
|
by: Bob Day |
last post by:
VS 2003, vb.net...
Is there a way to determine the line number currently executing in your
code, so you can log this line number information (e.g. via trace)?
Thanks!
Bob Day
|
by: pukya78 |
last post by:
Hi,
I am trying to get the current file and the line number which is
getting executed. I used:
MessageBox.Show(New StackTrace(New
StackFrame(True)).GetFrame(0).GetFileLineNumber) which gives me...
|
by: Hari Sekhon |
last post by:
Hi,
I'm wondering if anyone can please help me on figuring out a better way
of doing an excepthook. I have a script which is using an excepthook to
catch any uncaught exceptions - there usually...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |