Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

ArrayIterator fixes and unit tests #123

Merged
merged 4 commits into from
Aug 9, 2013
Merged

ArrayIterator fixes and unit tests #123

merged 4 commits into from
Aug 9, 2013

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Aug 7, 2013

This fixes a few things:

  • Appending array elements with []
  • valid() might report incorrectly if an element value was false

It leaves the following behaviors in place:

  • offsetExists() simply calls isset(), so it can't differentiate between offsets not existing and existing but with a null value. There isn't a good resolution for this (see: this php.net bug report).
  • offsetGet() will return null even if the offset doesn't exist. Keeping this in place for BC, but I think the proper behavior would be to error out.

@jwage
Copy link
Member

jwage commented Aug 9, 2013

👍

jmikola added 4 commits August 9, 2013 13:36
This is necessary for supporting with [] operator to append elements.
Check key()'s return value instead, since it will not be confused for a legitimate array key.
jmikola added a commit that referenced this pull request Aug 9, 2013
ArrayIterator fixes and unit tests
@jmikola jmikola merged commit 7aae8aa into master Aug 9, 2013
@jmikola jmikola deleted the arrayiterator branch August 9, 2013 17:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants