array_flatten() in PHP

$arrays ? call_user_func_array(‘array_merge’, $arrays) : array()

Advertisements

2 responses to this post.

  1. Posted by alina on March 12, 2013 at 11:14 am

    fails with $arrays=array()

    Reply

  2. Posted by chriswa on March 12, 2013 at 11:19 am

    Thanks! Good to know. It seems that a lot of PHP functions fail on degenerate cases like the one you pointed out. I’ve updated the post to support this one.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: