Bug #17612 Updated: print_r, var_dump - disable direct output

From: Date: Wed, 05 Jun 2002 13:31:14 +0000
Subject: Bug #17612 Updated: print_r, var_dump - disable direct output
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9546@lists.php.net to get a copy of this message
ID: 17612 Updated by: derick@php.net Reported By: postings.php.net@hans-spath.de -Status: Open +Status: Feedback Bug Type: Feature/Change Request Operating System: All PHP Version: 4.2.1 New Comment: var_dump can not be modified, as you can use it to dump more than one variable. print_r can be modified, but I don't see any reason to do it as var_export() already works fine. Derick Previous Comments: ------------------------------------------------------------------------ [2002-06-05 09:27:38] postings.php.net@hans-spath.de Ok, but what about print_r and var_dump? I don't like to have three functions doing a similar job but expecting different parameters. Furthermore the documentation for var_export should be more clearly. IMO "You can also return the variable representation by using TRUE as second parameter to this function." says it returns just the content of the variable as var_dump($var,true) did some time ago (IIRC). ------------------------------------------------------------------------ [2002-06-05 08:49:24] derick@php.net The second parameter to var_export makes the function return the information into a string, so this functionality is already implemented in someway. (also, IMO having it as an option is not an option :) Derick ------------------------------------------------------------------------ [2002-06-05 08:46:34] postings.php.net@hans-spath.de print_r, var_dump and var_export generate direct output. I don't like that, because when I dump a variable that contains HTML tags it messes up my output. I don't like to use some ob_* functions to get that output into a string before I can pass it through htmlentities because that's inperformant and looks ugly. I would like to have a function or a ini setting that controls the behavior of print_r, var_dump and var_export. There should be two modes: direct output and returning a string. I think that would be great to people who want to write debug informations into an external file, too. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17612&edit=1

« previous php.bugs (#9546) next »