-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*explode return array size. #700
Conversation
This would fail. Also, if one part is returning value, |
I believe it should stay as 7 ..... if it returned 2, it could lead to false array size value if the users have assigned value at the first 5 index of the array. if it return 2, the script might potentially overwritten any value in the array if the users used the returned value next. |
Explode must return how many indexes it has written to according to me... Maybe let someone else chime in to discuss what's better |
it's the same case.
the purpose of this changes was to reduce the usage of getarraysize() after used explode(). |
In my opinion, the main problem here is that it's like
I think this is misleading. I'd rather return the number of elements written, like Dastgir suggests. That way, if you need the index of the last element written, you can still retrieve it, since you know the index of the first element written:
On a side note, I just noticed the explode function leaks memory. The |
Taking ownership of this. I'll handle the problems mentioned |
Merged as 6a0093b, thank you |
http://herc.ws/board/topic/7489-explode-to-push-arraysize/