|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-04-02 18:29 UTC] php at htmlland dot net
Description: ------------ Shoulden't the return on print_r() be mixed not bool as shown on the documentation page? I say this because the return parameter changes the output returned to a string not a bool. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 15:00:02 2025 UTC |
"Mixed" is not terribly descriptive though. Maybe... Index: en/reference/var/functions/print-r.xml =================================================================== RCS file: /repository/phpdoc/en/reference/var/functions/print-r.xml,v retrieving revision 1.12 diff -u -r1.12 print-r.xml --- en/reference/var/functions/print-r.xml 7 Mar 2006 01:12:15 -0000 1.12 +++ en/reference/var/functions/print-r.xml 8 Apr 2007 19:42:19 -0000 @@ -11,7 +11,7 @@ <refsect1> <title>Description</title> <methodsynopsis> - <type>bool</type><methodname>print_r</methodname> + <type>bool/string</type><methodname>print_r</methodname> <methodparam><type>mixed</type><parameter>expression</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>return</parameter></methodparam> </methodsynopsis> I don't know if we allow that.Ref: bool print_r ( mixed $expression [, bool $return] ) Agree that the return on print_r() should be "mixed" not "bool" as print_r either returns a bool or a string: If $return is not specified or set to false then print_r returns a bool of TRUE if command is successful - or - a bool of FALSE on error If $return == TRUE then print_r either returns a string if command completes OK - or - a bool FALSE on errors Correct syntax is: mixed print_r ( mixed $expression [, bool $return] ) Although "mixed" is not very descriptive, this usage is consistent with the rest of the documentation.