From:             milky at users dot sf dot net
Operating system: Linux, glibc2.3
PHP version:      5.0.0
PHP Bug Type:     Strings related
Bug description:  echo "0";  terminates output

Description:
------------
(Hard to reproduce.)

In one of my scripts any variant of outputting a variable set to (string)
"0" ended the output. Appearantly happened for var_dump(), print_r(),
echo() and print().

Initially it appeared to be a pcre problem:
$_SERVER["QUERY_STRING"] = "q=example&s=0&s=1&s=7";
preg_match_all('/&s=(\d+)/', $_SERVER["QUERY_STRING"], $uu);
echo implode(" ", $uu[1]);

But it probably isn't. Appears that earlier parts of any of the other
included scripts changed interpreter behaviour and lead to the strange
effect. It seems not configuration-related or to be a general bug, as the
same <?php echo "0";' ?> gives no problem in short scripts.

Only fails in CGI environment, doesn't happen on cmdline.

same effect:
- echo "0";
- echo '0';

OTH this doesn't output anything strange (binary):
- echo "1";

Not sure, if this is a bug at all. The "0" breaks also with 5rc2, 4.3.x
and down to 4.1.2 (all in -cgi/fcgi incarnation)

But btw:
  echo "\000"; echo "+++";
  echo "0"; echo "...";
will correctly return the [EMAIL PROTECTED] but nothing after that.

related to #16388 ?


Reproduce code:
---------------
<?php
//...
#...
#
include("htm/head");   # contains no php code
echo "0";              # ends output

// more code follows
#... (all other code and include()s being commented out to reproduce)
?>



-- 
Edit bug report at http://bugs.php.net/?id=29279&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29279&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29279&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29279&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29279&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29279&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29279&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29279&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29279&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29279&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29279&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29279&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29279&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29279&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29279&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29279&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29279&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29279&r=float

Reply via email to