Bug #71420 [NEW]: Can't echo very large strings

From: Date: Wed, 20 Jan 2016 14:12:47 +0000
Subject: Bug #71420 [NEW]: Can't echo very large strings
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198796@lists.php.net to get a copy of this message
From:             mark at interactivedimension dot com
Operating system: Linux
PHP version:      5.6.17
Package:          Performance problem
Bug Type:         Bug
Bug description:Can't echo very large strings

Description:
------------
Hi

I'm not sure if this is a php bug or some kind of server config.

The script below will not run on my shared server at all. It will
however work on my local machine.

It will output a string of up to approx 2million characters but there
comes a point where the page just hangs and never loads.

I can't figure out a way around this. I've tried breaking the string
into smaller parts but I can only output so much before the same thing
happens.

Test script:
---------------
<?php

$data = '';

for($i = 0; $i < 3000000; $i++) {
	$data .= 1;
}

echo $data;

?>


-- 
Edit bug report at https://bugs.php.net/bug.php?id=71420&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71420&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71420&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71420&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71420&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71420&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71420&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71420&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71420&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71420&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71420&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71420&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71420&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71420&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71420&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71420&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71420&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71420&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71420&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71420&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71420&r=mysqlcfg



Thread (8 messages)

« previous php.bugs (#198796) next »