3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $buffer = -1; function callback($output) { global $buffer; $buffer = $output; return $output.'r'; } ob_start('callback'); echo 'hello'; print_r(ob_get_status()); $a = ob_get_contents(); ob_get_clean(); echo $a; var_dump($buffer);
Output for 5.4.10 - 7.1.0
helloArray ( [name] => callback [type] => 1 [flags] => 113 [level] => 0 [chunk_size] => 0 [buffer_size] => 16384 [buffer_used] => 5 ) string(162) "helloArray ( [name] => callback [type] => 1 [flags] => 113 [level] => 0 [chunk_size] => 0 [buffer_size] => 16384 [buffer_used] => 5 ) "
Output for 5.4.0 - 5.4.9
helloArray ( [name] => callback [type] => 1 [flags] => 113 [level] => 0 [chunk_size] => 0 [buffer_size] => 16384 [buffer_used] => 5 ) string(0) ""
Output for 4.3.0 - 5.3.29
helloArray ( [level] => 1 [type] => 1 [status] => 0 [name] => callback [del] => 1 ) string(104) "helloArray ( [level] => 1 [type] => 1 [status] => 0 [name] => callback [del] => 1 ) "