Solution:
if you want to check the return of this code use var_dump() :
try this:
$str = "Hello World!"; var_dump(count_chars($str , 0));