mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
1b29e0cacd
Instead of directly writing to stdout. This allows doing a print_r into a string, without using output buffering. The motivation for this is bug #67467: print_r() in return mode will still dump the string to stdout (causing a potential information leak) if a fatal error occurs.
14 lines
147 B
PHP
14 lines
147 B
PHP
--TEST--
|
|
output buffering - fatalism
|
|
--FILE--
|
|
<?php
|
|
function obh($s)
|
|
{
|
|
return print_r($s, 1);
|
|
}
|
|
ob_start("obh");
|
|
echo "foo\n";
|
|
?>
|
|
--EXPECTF--
|
|
foo
|