Skip to content

Instantly share code, notes, and snippets.

@thbourlove
Created December 31, 2013 06:08
Show Gist options
  • Save thbourlove/8193242 to your computer and use it in GitHub Desktop.
Save thbourlove/8193242 to your computer and use it in GitHub Desktop.
<?php
$arr = [];
for ($i = 0; $i < 5000; $i++) {
$arr[$i] = range($i, $i+1);
}
$res = array();
array_walk_recursive($arr, function ($item, $key) use (&$res) {
$res[] = $item;
});
<?php
$arr = [];
for ($i = 0; $i < 5000; $i++) {
$arr[$i] = range($i, $i+1);
}
$res = array();
foreach ($arr as $item) {
foreach ($item as $value) {
$res[] = $value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment