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(''); ?> <html> <body> <p>It's like comparing apples to oranges.</p> </body> </html> <?php ob_end_flush(); ?>
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
<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 hhvm-3.10.0 - 3.12.0
<html> <body> <p>It's like comparing oranges to oranges.</p> </body> </html> Warning: Invalid argument: function: method '' not found in /in/328am on line 27 <html> <body> <p>It's like comparing apples to oranges.</p> </body> </html>
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>