PHP解析错误:第3行的语法错误...它可以变得更简单吗?

0 php arrays parsing include

我一直在和这个人摔跤; 我有一个小阵列,我想包括:

mywords.php

<?php
$words = (
"test",
"one",
"two",
"three",
);
?>
Run Code Online (Sandbox Code Playgroud)

我当然在html中正确包含它:

<?php
ini_set('display_errors',1); 
error_reporting(E_ALL);
include('wordlist.php');
?>
Run Code Online (Sandbox Code Playgroud)

但每次我运行它,无论我制作数组有多大或多小,我都会收到以下错误:

Parse error: syntax error, unexpected ',' in /home/joedi3/faufum.com/wordlist.php on line 3
Run Code Online (Sandbox Code Playgroud)

我已经尝试了一切; 这是我的phprc看起来像:

log_errors = 1
error_log = /home/joedi3/php.log
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 500
max_input_time = 500
Run Code Online (Sandbox Code Playgroud)

我怀疑这甚至是重要的,但我想我会把它包括在内,因为它是我能想到的唯一可能弄乱它的东西.

Joh*_*nde 5

短数组语法使用括号,而不是括号:

<?php
$words = [
"test",
"one",
"two",
"three",
]
?>
Run Code Online (Sandbox Code Playgroud)