NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Variable Dump


Joined: 27 Mar 2006
Posts: 77
Reply with quote
Is there any way, dbg or not, to dump the value of every variable to the screen or perferably a string.

I want to trap errors in my application then email myself all values so I can recreate what happened in a test environment. I have not seen any regular php functions that can accomplish this but I may have over looked it.

Thanks for you help.
View user's profileFind all posts by twSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
If I understand you correct, you need a way to dump ALL variables, including a) globals, b) variables located in the outer scope and c) current local ones. In other words, if say function A is called from global context and it subseqently called function B and it means that you need all globals, all local variables in function A and all local variables in function B, right?
There is no such functions in PHP. With debugger you can dump them easily but still this info is available during debug session.

On the other hand, to me it does not look as a correct approach. Even if all and all the values are known, its still unclear what way the execution went on before. Said it, I'd recommend you to play with DebugBreak() function. Just add this call to the code point of the interest and it will start debugger when execution reaches it and you'll see not only variables but will be able to continue execution and/or modify values and see all the functions in the outer scope too (so-called Call Stack).
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 27 Mar 2006
Posts: 77
Reply with quote
Yeah it isn't the best way to handel errors but I am to repress them and alert myself when they happen from the live system. The only way I can do that is by emailing myself and I figured having the most recent values would be helpful.
View user's profileFind all posts by twSend private message
Variable Dump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic