3v4l.org

run code in 200+ 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(''); ?> <html> <body> <p>It's like comparing apples to oranges.</p> </body> </html> <?php ob_end_flush(); ?>
Output for 5.4.0 - 7.1.7
<html> <body> <p>It's like comparing oranges to oranges.</p> </body> </html> Warning: ob_start(): function '' not found or invalid function name in /in/328am on line 27 Notice: ob_start(): failed to create buffer in /in/328am on line 27 <html> <body> <p>It's like comparing apples to oranges.</p> </body> </html> Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in /in/328am on line 37
Output for 5.3.4 - 5.3.29
<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> Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in /in/328am on line 37
Output for 4.3.2 - 5.3.3
<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> Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush. in /in/328am on line 37
Output for 4.3.0 - 4.3.1
<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>