1--TEST-- 2Test ob_get_length() function : basic functionality 3--INI-- 4output_buffering=0 5--FILE-- 6<?php 7function dump_string_length( $string ) 8{ 9 ob_start(); 10 echo $string; 11 $len = ob_get_length(); 12 ob_end_clean(); 13 var_dump( $len ); 14} 15 16echo "*** Testing ob_get_length() : basic functionality ***\n"; 17 18// No buffering active 19var_dump( ob_get_length() ); 20 21dump_string_length( 'foo bar length of a string' ); 22dump_string_length( 'plus one' ); 23dump_string_length( "\0" ); 24dump_string_length( ' lsf' ); 25dump_string_length( '' ); 26dump_string_length( null ); 27 28?> 29--EXPECT-- 30*** Testing ob_get_length() : basic functionality *** 31bool(false) 32int(26) 33int(8) 34int(1) 35int(15) 36int(0) 37int(0) 38