#1 March 14, 2018 9:59am

joeignition
Member
Registered: February 11, 2015
Posts: 10

Shortcut array creation causing PHP parse errors

Not sure if this affects other versions of PHP, this client's server is on PHP 5.3.3 (not my choice).

Creating an array via [ ] appears to be the problem, replacing these with array( ) resolves the issue.

PHP Parse error:  syntax error, unexpected '[', expecting ')' in /core/inc/bigtree/sql-class.php on line 30
(only first instance shown)

Affected files are cms.php & sql-class.php

Joe

Offline

#2 March 14, 2018 10:07am

joeignition
Member
Registered: February 11, 2015
Posts: 10

Re: Shortcut array creation causing PHP parse errors

Oh yeah, anything less than PHP 5.4 will throw these errors and prevent proper function. May want to update documentation if you're only supporting PHP 5.4+

Offline

#3 March 14, 2018 10:20am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 895

Re: Shortcut array creation causing PHP parse errors

Thanks for the bug report! I pushed a fix to 4.2-devel that will only load the new (beta) SQL class on PHP 5.4+ as well as fixing the [] usage in cms.php back to array().

We're going to support PHP 5.3 in the 4.x branch (including the upcoming 4.3 release) but conditionally add features that require newer versions of PHP. BigTree 5 will require PHP 7.1 when it's released (hopefully late this year).

Offline

#4 March 14, 2018 11:10am

joeignition
Member
Registered: February 11, 2015
Posts: 10

Re: Shortcut array creation causing PHP parse errors

My solution was to push for upgrading to PHP 5.6.x

Thanks!
Joe

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.