Issues

ZF-10881: ob_get_contents + ob_get_clean can be done by ob_get_clean

Description

found in: library/Zend/Cache/Frontend/Function.php library/Zend/Cache/Frontend/Output.php library/Zend/Soap/Client/Local.php tests/Zend/Cache/ClassFrontendTest.php tests/Zend/Cache/FunctionFrontendTest.php tests/Zend/Cache/OutputFrontendTest.php tests/Zend/Cache/PageFrontendTest.php tests/Zend/ConfigTest.php tests/Zend/DebugTest.php

Comments

fixed in r23590 (trunk) & r23591 (1.11 branch)

This issue is marked as performance improvement, but did you do any benchmarks on this issue?

from php doc: {quote}ob_get_clean() essentially executes both ob_get_contents() and ob_end_clean().{quote}

this is a simple bench out (runs 1000000):


ob_get_clean: 0.54880809783936
ob_get_contents + ob_end_clean: 0.63402605056763

-> I know it only a mini difference but the code is a little bit more clean.


$data = ob_get_contents();
ob_end_clean();
// vs.
$data = ob_get_clean();

Hi @Marc

This issue only will be applied in release 1.11.3 because already was generated the tag 1.11.2 these case should be regenerated the tag or merged changes to tag. Anyway enter in contact with [~matthew].

Greetings Ramon Henrique Ornelas

I'm re-opening so that it doesn't get included in the release changelog, as it was applied after the tag and packages for 1.11.2 were created. I'll close again once the release has occurred.