| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2002-06-20 11:47 UTC] che at atlantic dot net
 The code below outputs to the screen. (Even with output buffering) ob_start(); $v = var_export($GLOBALS, TRUE); ob_end_clean(); PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 05:00:01 2025 UTC | 
<? $foo=var_export($GLOBALS,TRUE); ?> (whithout or not output buffering). It's the same problem: var_export outputs to the screen $GLOBALS and then die with an error message. So that's not a bug... Ok now imagine you're using a this script in in your website, and you haven't noticed that error. With an example it's more easy to understand: <? function save_anywhere($foo) { $save=var_export($foo,TRUE); /* ... */ } save_anywhere(&$GLOBALS); ?> You wish to save $GLOBALS for a any reason (log, ...) and what's the result ? var_export produces an error and outputs ALL your variables directly to the user, wich now can hack your site just because he has your $mdp = "..." :) It's maybe not necessary to output a variable that was destinated (with the second parameter TRUE) to be stocked anywhere except in the user HD.