Hmm, it's no GOTO, but oddly enough we have virtually exactly the same 
function and use it everywhere too.  The only differences are we call ours 
pre_r() and we add the following check against php_sapi_name() so that the 
function behaves sanely when called from the cli:

function pre_r($mixed, $return) {

   if ( php_sapi_name()  == "cli" ) {
     if ( $return )
       return print_r($mixed, true);
     print_r($mixed);

   } else {

     if ( $return )
      return "<pre>" . print_r($mixed, true) . "</pre>";

    echo "<pre>";
    print_r($mixed);
    echo "</pre>";
  }

}

While I don't know if it *needs* to be in the core, if it were I'd certainly 
use it.

My $0.02,

Benj Carson

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to