Error syntax error, unexpected t VARIABLE

I'm having a problem and I'm a beginner in PHP, I don't know if it's easy to fix this error.

(Parse error: syntax error, unexpected T_VARIABLE in / home / u611580299/public_html/wp-content/themes/simplicityantigo/includes / google-fonts.php on line 1)

<?php
global $fontArrays;

$fontArrays = array(
    0 =>
    array(
        'kind' => 'webfonts#webfont',
        'family' => 'ABeeZee',
        'variants' =>
        array(
            0 => 'regular',
            1 => 'italic',
        ),
        'subsets' =>
        array(
            0 => 'latin',
        ),
    ),
    // ...
);
?>

Complete file

Author: Jorge B., 2014-12-18

1 answers

The problem here is in the use of the keyword global.

global serves to reference within the scope of a function a variable in the global scope:

<?php

$a = 5;
$b = 3;

function soma(){
    $a = 1;
    $b = 2;

    return $a + $b;
}

function somaGlobal(){
    // A partir desse ponto, $a = 5 e $b = 3
    global $a, $b;

    return $a + $b;
}

echo soma();        // escreve 3
echo somaGlobal();  // escreve 8
 5
Author: gmsantos, 2014-12-18 10:20:01