Hi
2015-03-07 18:35 GMT+01:00 Sebastian B.-Hagensen <[email protected]>:
> Hi,
> I don't think the alias make sense and is really misleading and I've
> seen sizeof("abc"); often enough (Don't get me wrong that's equally
> bad with count, but sizeof encourages that usage, imo).
> Having two functions that do exactly the same using different names
> for no good reason (one of them referring to a different operation in
> a more popular language) isn't optimal. Code using a deprecated sizeof
> call is trivial to fix.
Well we could make count()/sizeof() work for strings, so that if:
C:\> php -r "echo sizeof('abc');"
3
although it would not really accomplish much imo., I think it is more
of what background you come from that makes the most sense to me, I
got into PHP before C and I enjoy sizeof more for array sizes than
count, but that is just a pure preference.
--
regards,
Kalle Sommer Nielsen
[email protected]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php