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

Fixes #3773 #5836

Closed
wants to merge 2 commits into from
Closed

Conversation

steverhoades
Copy link
Contributor

Fixed some minor issues with suggested fix.

@Maks3w Maks3w added the Json label Feb 22, 2014
@weierophinney weierophinney added this to the 2.2.6 milestone Mar 3, 2014
{
$keys = array_keys($array);

return ($keys != array_keys($keys));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing - on what is this logic based?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ocramius It's similar to what we have in Zend\Stdlib\ArrayUtils::isHashTable() -- essentially, you're testing to see if the array keys are sequential starting with 0. If they are not, it's an associative array. In ArrayUtils, we test if array_values($array) !== $array. Both work.

@weierophinney weierophinney self-assigned this Mar 4, 2014
weierophinney added a commit that referenced this pull request Mar 4, 2014
weierophinney added a commit that referenced this pull request Mar 4, 2014
weierophinney added a commit to zendframework/zend-json that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-json that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-json that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants