1

I'm trying to install OpenDocman, and am getting this error:

Parse error: syntax error, unexpected '[' in blablahblah/TemplateRegistry.php on line 156

The line in question reads:

$this->found = [];

Which suggests to me that my version of php (5.3.29) doesn't like this syntax. I'm assuming that the intent is to set 'found' to an empty array.

What's the best way to tackle this please?

3
  • 2
    Upgrade your php?! Commented Jul 6, 2016 at 9:08
  • 2
    upgrade your php or use array(); Commented Jul 6, 2016 at 9:09
  • 2
    install php 5.4 or higher Commented Jul 6, 2016 at 9:09

3 Answers 3

3

The short syntax for arrays was added to PHP5.4.

You have to possibilites of fixing this:

Updating PHP

Install a newer version of PHP, for this function you need atleast PHP5.4. Help on upgrading to newer versions can be found here: http://php.net/manual/en/migration70.php

Old array syntax

You can use the old array syntax:

$this->found = array(); 
Sign up to request clarification or add additional context in comments.

Comments

2

in php 5.3 or less will not support python or java-script like array's ( [] )

So you have to use 5.4+ to use this feature.

But now use array() instead of []

read PHP manual for arrays

Comments

0

With php 5.3, you can used $this->found =array()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.