3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function callback($buffer) { // replace all the apples with oranges return (str_replace("apples", "oranges", $buffer)); } ob_start("callback"); ?> <html> <body> <p>It's like comparing apples to oranges.</p> </body> </html> <?php ob_end_flush(); function callback2($buffer) { // replace all the apples with oranges return (str_replace("apples", "oranges", $buffer)); } ob_start(null); ?> <html> <body> <p>It's like comparing apples to oranges.</p> </body> </html> <?php ob_end_flush(); ?>
Output for 4.3.0 - 7.1.0
<html> <body> <p>It's like comparing oranges to oranges.</p> </body> </html> <html> <body> <p>It's like comparing apples to oranges.</p> </body> </html>