3v4l.org

run code in 200+ php & hhvm versions
<?php function callback($buffer, $status) { return "callback $buffer"; } ob_start( 'callback', 0, PHP_OUTPUT_HANDLER_FLUSHABLE | PHP_OUTPUT_HANDLER_REMOVABLE); echo 'test'; echo ob_get_clean(); //this should not work as no CLEANABLE flag was set on ob_start //ob_end_clean is ran as well //ob_clean -> failed to delete buffer notice echo "\n".ob_get_level();
Output for 5.4.0 - 5.6.30, hhvm-3.10.1 - 3.17.3, 7.0.0 - 7.2.6
test 0
Output for 4.3.0 - 5.3.29
Notice: Use of undefined constant PHP_OUTPUT_HANDLER_FLUSHABLE - assumed 'PHP_OUTPUT_HANDLER_FLUSHABLE' in /in/G1Eqn on line 8 Notice: Use of undefined constant PHP_OUTPUT_HANDLER_REMOVABLE - assumed 'PHP_OUTPUT_HANDLER_REMOVABLE' in /in/G1Eqn on line 8 test 0