3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $buffer = -1; function callback($output) { global $buffer; $buffer = $output; return 'R'; } ob_start('callback'); echo 'hello'; //$a = ob_get_contents(); $b = ob_get_clean(); echo $b; var_dump($buffer);
Output for 4.3.0 - 5.3.29, 5.4.10 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
hellostring(5) "hello"
Output for 5.4.0 - 5.4.9
hellostring(0) ""