3v4l.org

run code in 500+ PHP versions simultaneously
<?php $columns=[ 'id', 'snippet'=>[ 'publishedAt', 'channelId', 'channelTitle', 'description', 'thumbnails'=>[ 'default'=>['url','width','height'], 'medium'=>['url','width','height'], 'high'=>['url','width','height'], 'standard'=>['url','width','height'], 'maxres'=>['url','width','height'] ], 'tags', 'categoryId' ], 'status'=>[ 'uploadStatus', 'privacyStatus', 'license', 'embeddable', 'publicStatsViewable', 'madeForKids' ], 'statistics'=>[ 'viewCount', 'likeCount', 'favoriteCount', 'commentCount' ] ]; function simplify($columns, $root = '') { $output = []; $root .= ($root == '' ? '' : '-'); foreach ($columns as $key => $value) { if (is_array($value)) { $output = array_merge($output, simplify($value, $root . $key)); } else { $output[$root . $value] = 1; } } return $output; } var_export(simplify($columns));

preferences:
90.61 ms | 1478 KiB | 5 Q