[PHP] Why count() returns no error when string is given ?

2011-08-16 Thread rsk82
For example when I do: strlen(array(1,2,3)); php shows: Warning: strlen() expects parameter 1 to be string, array given in... but when I do: count('string'); It simply returns 1 like nothing happened. I would expect such behavior if I write: count((array)'string') but otherwise such

Re: [PHP] Why count() returns no error when string is given ?

2011-08-16 Thread rsk82
, not by an accident ? Is this behavior having some grand purpose behind id, or is it just a historical accident for early days of php ? -- Best regards, rsk82mailto:rs...@live.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php