Skip to content

Instantly share code, notes, and snippets.

@sybrew
Last active August 9, 2016 16:37
Show Gist options
  • Save sybrew/c654ebe5d0799e5b39cb407443df6775 to your computer and use it in GitHub Desktop.
Save sybrew/c654ebe5d0799e5b39cb407443df6775 to your computer and use it in GitHub Desktop.
<?php
/**
* Converts array to make a compatible list for both PHP5 and PHP7.
*
* @param array $array The array to convert.
* @return array $list in correct order to use PHPFUNCTION list().
*/
function prepare_list( array $array = array() ) {
if ( PHP_VERSION_ID >= 70000 )
$array = array_reverse( $array );
return $array;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment