ZF-12449: OutputCache caches boolean result of buffering NOT a string

Issue Type: Bug Created: 2012-10-22T10:35:16.000+0000 Last Updated: 2012-11-06T21:28:42.000+0000 Status: Closed Fix version(s): Reporter: Stanislav Protasevich (stanislav.protasevich) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Cache

  • cache

Related issues: Attachments:


As a result OutputCache puts in cache file boolean result of buffering.

<pre class="highlight">
public function end()
    $key = array_pop($this->keyStack);
    if ($key === null) {
        throw new Exception\RuntimeException('Output cache not started');
    $output = ob_end_flush(); // boolean
    if ($output === false) {
        throw new Exception\RuntimeException('Output buffering not active');

    return $this->getOptions()->getStorage()->setItem($key, $output);

Please use {color:green}ob_get_flush(){color} instead {color:red}ob_end_flush(){color}, which returns result of buffering as a string.


Posted by Rob Allen (rob) on 2012-11-06T21:21:52.000+0000

I can't actually find this code!

Posted by Frank Brückner (frosch) on 2012-11-06T21:25:18.000+0000

It is code from version 2: Zend\Cache\Pattern\OutputCache!

Look at:…

Posted by Rob Allen (rob) on 2012-11-06T21:27:39.000+0000


Thanks Frank :)

Posted by Rob Allen (rob) on 2012-11-06T21:28:42.000+0000

This is a ZF2 issue, which is addresses here:

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.