Access variables outside of a PHP function
Author | Message |
---|---|
Locust | # Posted one week ago |
Hello I'm trying to code a PHP error display function function onError($errno, $errstr, $errfile, $errline)except that the dump only show me the variables present in the function, whereas I want all the variables of the code if possible Do you know how to do it ? thank you ! |
|
Ads | |
Phoenix | # Posted yesterday |
Your code is disgusting, and I say that as someone who has forked both your sisters. Otherwise -> global variables. |
|
Valter | # Posted yesterday |
Either you somehow manage to ensure that the variables are passed as arguments in your function. Either, as the transsexual above suggests, you use $GLOBALS . |
|
Locust | # Posted two hours ago |
Ok, I have my variables with GLOBALS thank you. the problem is that GLOBALS seems to bite its tail and tends to include itself in its variables which causes an infinite iteration of the dump function... do you have an idea of how to get out of this predicament, without resorting to the brutish method which would "block" the loop after a predetermined number of laps? |
|
Phoenix | # Posted one hour ago |
unset($GLOBALS['GLOBALS']);Or some equivalent noobistry. |
|
Valter | # Posted 37 minutes ago |
if ($key != 'GLOBALS')rather. In or before the dump function preferably. @Phoenix: You who likes to bitch about disgusting code. |
|
Locust | # Posted 5 minutes ago |
thank you ! it works flawlessly, that's exactly what I wanted! |