Re: Update email address of comment

From: Date: Wed, 27 Feb 2013 22:42:07 +0000
Subject: Re: Update email address of comment
References: 1 2 3 4 5 6  Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-15589@lists.php.net to get a copy of this message
I just reworded (see below), and also I improved code slightly. Note that, currently, my previous note shows. I assume that will change soon. Note: The code below illustrates usage of the second parameter, in particular to protect against fatal out-of-memory errors. It outputs: 1000000 1000000 error Tested with PHP 5.3 on 32bit Linux. <?php function tryToGzinflate($deflatedData, $maxLen = 0) { $data = gzinflate($deflatedData, $maxLen); if ($data === false) echo 'error<br>'; else echo strlen($data).'<br>'; } // random data: $data = ''; for ($i = 0; $i < 1000000; $i++) $data .= chr(mt_rand(97, 122)); // a-z $deflatedData = gzdeflate($data); ini_set('memory_limit', '5M'); // plenty of memory tryToGzinflate($deflatedData); tryToGzinflate($deflatedData, strlen($data)); ini_set('memory_limit', '100'); // little memory tryToGzinflate($deflatedData, 100); tryToGzinflate($deflatedData); // causes fatal out-of-memory error

« previous php.webmaster (#15589) next »