Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16254 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49833 invoked by uid 1010); 16 May 2005 14:42:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53407 invoked from network); 16 May 2005 14:17:12 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 16 May 2005 14:17:12 -0000 X-Host-Fingerprint: 24.71.223.10 shawidc-mo1.cg.shawcable.net Received: from ([24.71.223.10:22481] helo=pd4mo1so.prod.shaw.ca) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 85/39-36148-86BA8824 for ; Mon, 16 May 2005 10:17:12 -0400 Received: from pd5mr5so.prod.shaw.ca (pd5mr5so-qfe3.prod.shaw.ca [10.0.141.181]) by l-daemon (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0IGL00MSY6AUZ5D0@l-daemon> for internals@lists.php.net; Mon, 16 May 2005 08:16:06 -0600 (MDT) Received: from pn2ml9so.prod.shaw.ca ([10.0.121.7]) by pd5mr5so.prod.shaw.ca (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0IGL003AV6AUBN30@pd5mr5so.prod.shaw.ca> for internals@lists.php.net; Mon, 16 May 2005 08:16:06 -0600 (MDT) Received: from S01060050babc7470.ed.shawcable.net (S01060050babc7470.ed.shawcable.net [68.149.201.28]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003)) with ESMTP id <0IGL0041R6AUZZ@l-daemon> for internals@lists.php.net; Mon, 16 May 2005 08:16:06 -0600 (MDT) Received: from localhost (localhost [127.0.0.1]) by loki.digitaljunkies.ca (Postfix) with ESMTP id A7D2C4B475; Mon, 16 May 2005 08:16:01 -0600 (MDT) Received: from S01060050babc7470.ed.shawcable.net ([127.0.0.1]) by localhost (loki [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27793-08; Mon, 16 May 2005 08:16:00 -0600 (MDT) Received: from mjollnir.digitaljunkies.ca (mjollnir [10.1.1.16]) by loki.digitaljunkies.ca (Postfix) with ESMTP id 16A3C4A924; Mon, 16 May 2005 08:16:00 -0600 (MDT) Date: Mon, 16 May 2005 08:16:03 -0600 In-reply-to: <20050513112935.50036.qmail@lists.php.net> To: internals@lists.php.net Cc: info@php-hr.net Message-ID: <200505160816.03573.benjcarson@digitaljunkies.ca> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit Content-disposition: inline X-Virus-Scanned: by amavisd-new at digitaljunkies.ca References: <20050513112935.50036.qmail@lists.php.net> User-Agent: KMail/1.7.2 Subject: Re: [PHP-DEV] Function proposal From: benjcarson@digitaljunkies.ca (Benj Carson) 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 "
" . print_r($mixed, true) . "
"; echo "
";
    print_r($mixed);
    echo "
"; } } 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