Mantis - Quercus
Viewing Issue Advanced Details
1682 major always 04-11-07 07:21 04-11-07 15:57
obaltz  
nam  
normal  
closed 3.0.23  
fixed  
none    
none 3.1.1  
0001682: Quercus: print_r() ignores return parameter
On quercus, it seems like print_r always prints its output, regardless of the 2nd argument (return param).

The php docs say: "If you would like to capture the output of print_r(), use the return parameter. If this parameter is set to TRUE, print_r() will return its output, instead of printing it (which it does by default)."

See Additional Information for a demo script.
<?php
$a = array( 0,1,2,3,4,5,6,7,8,9 );
$b = print_r( $a, true ); // should store output in $b without printing it
print( 'Neither $a nor $b have ever been printed!' );
?>

Quercus outputs:

Array
(
    [0] => 0
    [1] => 1
    [2] => 2
    [3] => 3
    [4] => 4
    [5] => 5
    [6] => 6
    [7] => 7
    [8] => 8
    [9] => 9
)
Neither $a nor $b have ever been printed!

Notes
(0001837)
nam   
04-11-07 15:57   
php/124f