Created
August 11, 2016 14:19
-
-
Save aguimaraes/8a53227c837c034eb1deae54fa3a3130 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$expectedLength = count(reset($values)); | |
$diffLength = count(array_intersect_key(...$values)); | |
if ($diffLength !== $expectedLength) { | |
throw new LengthException("Element size differs ({$diffLength} should be {$expectedLength})"); | |
} | |
$items = array_map(function (...$items) { | |
return $items; | |
}, ...$values); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment