A php bug or?..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

                            As we all know, count() returns 1 if the variable is not an array.
Question is: why in the world does it this? If a variable is *notA* an array, it contains *zero* array elements.
You can answer: "but no, man, you can say
$x="world";
$y=$x{3}; // $y="l"

so the variable is treated or can be treated as an array".
Well. If strings are treated like arrays, why count($x) doesn't return 5 instead of 1?
Just asking.

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Blog: http://oire.org/menelion
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux