Jump to content

How to check the length of array?


Snubby

Recommended Posts

It would be very slightly more efficient to use count instead of sizeof, since sizeof is an alias of count.
did they just make sizeof() to be an alias of count() because programmers are used to using sizeof() in C? Or is there a more indepth reason?
Link to comment
Share on other sites

That might be one reason, or maybe because it was supported in an earlier version of PHP, and then they changed it to count for whatever reason.
Thanks,It seems odd that they would stop using sizeof() in favor of count() when PHP is so much like C. Probably got requests for sizeof() or questions about so they desided to alias it.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...