Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #14469

Re: Purpose for a str_replace with an embedded print_r return

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.php
Subject Re: Purpose for a str_replace with an embedded print_r return
Date 2014-11-05 14:27 +0100
Organization PointedEars Software (PES)
Message-ID <45658857.s58lGopVbh@PointedEars.de> (permalink)
References (1 earlier) <m3aq5j$hii$1@solani.org> <064143e2-28d1-40e4-a76e-c6d28b05dddb@googlegroups.com> <2023723.LoZblivUAB@PointedEars.de> <m3b44i$n5h$1@solani.org> <m3b7dm$776$1@dont-email.me>

Show all headers | View raw


Jerry Stuckle wrote:

> On 11/4/2014 12:58 PM, Christoph M. Becker wrote:
>> Thomas 'PointedEars' Lahn wrote:
>>> I think the proper idiom is “to kill two birds with one stone”.  This
>>> appears to be debug code, and if you pass “true” as second parameter to
>>> print_r(), it returns the output instead of printing it.
>> 
>> Good catch! At least a plausible explanation for the strange construct.
>> […]
> 
> No, the OP already indicated the value was a simple string, not an array
> or object reference, so the print_r() is unnecessary (and potentially
> confusing).

Which part of “debug code” did you not understand?
 
> I suspect the original programmer just copied some debug code he didn't
> understand and inserted it into the script.

It figures: Never ascribe to competent intent and innocent mistake what can 
be ascribed to incompetence and malice instead :->

-- 
PointedEars
Zend Certified PHP Engineer
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Purpose for a str_replace with an embedded print_r return Dave Patoch <earthlydilemma@gmail.com> - 2014-11-04 06:20 -0800
  Re: Purpose for a str_replace with an embedded print_r return "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-04 16:08 +0100
    Re: Purpose for a str_replace with an embedded print_r return Dave Patoch <earthlydilemma@gmail.com> - 2014-11-04 07:27 -0800
      Re: Purpose for a str_replace with an embedded print_r return Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-04 16:58 +0100
        Re: Purpose for a str_replace with an embedded print_r return "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-04 18:58 +0100
          Re: Purpose for a str_replace with an embedded print_r return Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-04 13:54 -0500
            Re: Purpose for a str_replace with an embedded print_r return Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-05 14:27 +0100
              Re: Purpose for a str_replace with an embedded print_r return Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-05 08:46 -0500
                Re: Purpose for a str_replace with an embedded print_r return Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-05 15:32 +0100
                Re: Purpose for a str_replace with an embedded print_r return Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-05 10:44 -0500
                Re: Purpose for a str_replace with an embedded print_r return Matthew Carter <m@ahungry.com> - 2014-11-05 15:50 -0500
                Re: Purpose for a str_replace with an embedded print_r return Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-05 16:59 -0500
                Re: Purpose for a str_replace with an embedded print_r return "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-05 23:56 +0100
                Re: Purpose for a str_replace with an embedded print_r return Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-06 04:30 +0100
                Re: Purpose for a str_replace with an embedded print_r return Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-05 22:53 -0500
  Re: Purpose for a str_replace with an embedded print_r return Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-05 15:07 +0000
    Re: Purpose for a str_replace with an embedded print_r return Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-05 10:47 -0500
      Re: Purpose for a str_replace with an embedded print_r return Matthew Carter <m@ahungry.com> - 2014-11-05 15:51 -0500
        Re: Purpose for a str_replace with an embedded print_r return Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-05 17:00 -0500
          Re: Purpose for a str_replace with an embedded print_r return Matthew Carter <m@ahungry.com> - 2014-11-05 22:35 -0500
            Re: Purpose for a str_replace with an embedded print_r return Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-05 22:55 -0500
            Re: Purpose for a str_replace with an embedded print_r return Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-06 04:26 +0000
              Re: Purpose for a str_replace with an embedded print_r return Matthew Carter <m@ahungry.com> - 2014-11-06 00:09 -0500
                Re: Purpose for a str_replace with an embedded print_r return Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-06 23:59 +0000
            Re: Purpose for a str_replace with an embedded print_r return "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-06 18:43 +0100
        Re: Purpose for a str_replace with an embedded print_r return Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-06 02:39 +0000
      Re: Purpose for a str_replace with an embedded print_r return Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-06 02:44 +0000
        Re: Purpose for a str_replace with an embedded print_r return Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-05 22:56 -0500

csiph-web