/**
 * PHP patterns
 *
 * @author Craig Campbell
 * @version 1.0.1
 */
Rainbow.extend('php', [
    {
        'name': 'support',
        'pattern': /\becho\b/g
    },
    {
        'matches': {
            1: 'variable.dollar-sign',
            2: 'variable'
        },
        'pattern': /(\$)(\w+)\b/g
    },
    {
        'name': 'keyword.dot',
        'pattern': /\./g
    },
    {
        'name': 'keyword',
        'pattern': /\b(continue|break|end(for(each)?|switch|if)|case|require(_once)?|include(_once)?)(?=\(|\b)/g
    },
    {
        'matches': {
            1: 'keyword',
            2: {
                'name': 'support.class',
                'pattern': /\w+/g
            }
        },
        'pattern': /(instanceof)\s([^\$].*?)(\)|;)/g
    },
    /**
     * @todo limit this to the most commonly used PHP functions since this could grow really big
     */
    {
        'matches': {
            1: 'support.function'
        },
        'pattern': /\b(apc_(fetch|store)|array(_sum|_rand)?|asort|count|empty|explode|file_(get_contents|exists)|get_(called_)?class|getenv|in_array|is_(numeric|array|link)|isset|json_(encode|decode)|mt_rand|rand|rmdir|round|spl_autoload_register|str(tolower|str|pos|_replace)|trigger_error|un(link|set))(?=\()/g
    },
    {
        'name': 'phptag',
        'pattern': /(&lt;\?(php)?|\?&gt;)/g
    },
    {
        'matches': {
            1: 'keyword.namespace',
           2: {
                'name': 'support.namespace',
                'pattern': /\w+/g
            }
        },
        'pattern': /\b(namespace\s)(.*?);/g
    },
    {
        'matches': {
            1: 'keyword.class.description',
            2: 'keyword.class',
            3: 'meta.class-name',
            4: 'keyword.extends',
            5: 'meta.parent.class-name'
        },
        'pattern': /\b(abstract|final)?\s?(class)\s(\w+)(\sextends\s)?([\w\\]*)?\s?\{?\n/g
    },
    {
        'name': 'keyword.static',
        'pattern': /self::/g
    },
    {
        'matches': {
            1: 'keyword',
            2: 'support.magic'
        },
        'pattern': /(function)\s(__.*?)(?=\()/g
    },
    {
        'matches': {
            1: 'keyword.new',
            2: {
                'name': 'support.class',
                'pattern': /\w+/g
            }
        },
        'pattern': /\b(new)\s([^\$].*?)(?=\)|\(|;)/g
    },
    {
        'matches': {
            1: {
                'name': 'support.class',
                'pattern': /\w+/g
            }
        },
        'pattern': /([\w\\]*?)::\b/g
    },
    {
        'matches': {
            2: {
                'name': 'support.class',
                'pattern': /\w+/g
            }
        },
        'pattern': /(\(|,\s?)([\w\\]*?)(?=\s\$)/g
    }
]);

@@ -751,24 +751,25 @@
 ;)/g%0A    %7D,%0A
+%0A
     /**%0A    
@@ -775,46 +775,34 @@
   * 
-@todo limit this to the
+these are the top 50
  most 
-commonly 
 used
@@ -819,425 +819,626 @@
 ions
- since this could grow really big%0A     */%0A    %7B%0A        'matches': %7B%0A            1: 'support.function'%0A        %7D,%0A        'pattern': /%5Cb(apc_(fetch%7Cstore)%7Carray(_sum%7C_rand)?%7Casort%7Ccount%7Cempty%7Cexplode%7Cfile_(get_contents%7Cexists)%7Cget_(called_)?class%7Cgetenv%7Cin_array%7Cis_(numeric%7Carray%7Clink)%7Cisset%7Cjson_(enc
+%0A     * found from running a script and checking the frequency of each function%0A     * over a bunch of popular PHP frameworks then combining the results%0A     */%0A    %7B%0A        'matches': %7B%0A            1: 'support.function'%0A        %7D,%0A        'pattern': /%5Cb(array(_key_exists%7C_merge%7C_keys%7C_shift)?%7Cisset%7Ccount%7Cempty%7Cunset%7Cprintf%7Cis_(array%7Cstring%7Cnumeric%7Cobject)%7Csprintf%7Ceach%7Cdate%7Ctime%7Csubstr%7Cpos%7Cstr(len%7Cpos%7Ctolower%7C_replace%7Ctotime)?%7Cord%7Ctrim%7Cin_array%7Cimplode%7Cend%7Cpreg_match%7Cexplode%7Cfm
 od
-e
 %7Cde
-code)%7Cmt_rand%7Crand%7Crmdir%7Cround%7Cspl_autoload_register%7Cstr(tolower%7Cstr%7Cpos%7C_replace)%7Ctrigger_error%7Cun(link%7Cset)
+fine%7Clink%7Clist%7Cget_class%7Cserialize%7Cfile%7Csort%7Cmail%7Cdir%7Cidate%7Clog%7Cintval%7Cheader%7Cchr%7Cfunction_exists%7Cdirname%7Cpreg_replace%7Cfile_exists
 )(?=

Update php functions to use the most popular functions