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

2011-08-16 Thread Florian Lemaitre
Le 16/08/2011 16:29, rs...@live.com a écrit : 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

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

2011-08-16 Thread Florian Lemaitre
Le 16/08/2011 16:32, Florian Lemaitre a écrit : Le 16/08/2011 16:29, rs...@live.com a écrit : 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

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

2011-08-16 Thread rsk82
Hello Florian, Tuesday, August 16, 2011, 4:32:39 PM, you wrote: manual : function.count.php Returns the number of elements in/var/. If/var/is not an array or an object with implementedCountable http://www.php.net/manual/en/class.countable.phpinterface,/1/will be returned. There is one

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

2011-08-16 Thread Florian Lemaitre
Le 16/08/2011 16:50, rs...@live.com a écrit : Hello Florian, Tuesday, August 16, 2011, 4:32:39 PM, you wrote: manual : function.count.php Returns the number of elements in/var/. If/var/is not an array or an object with implementedCountable