This question already has an answer here:
- Unexpected bracket '[' - PHP [duplicate] 3 answers
PHP Syntax Check: Parse error: syntax error, unexpected '[' in your code on line 100
$clicks = each( $array )[1];
is this the correct syntax? (apologies for the noob question)
$clicks = each( $array [1]);
From section:
$array = array_count_values( $array );
unset( $array[''] );
do
{
$clicks = each( $array )[1];
$id = each( $array )[0];
if ( each( $array ) )
{
}
$clicks = each( $array )[1];
and$clicks = each( $array [1]);
would achieve totally different things. What are you actually trying to do? – Mark Baker Nov 9 '13 at 22:24$clicks = each( $array )[1];
is throwing the error, so I assume that would never be correct. But I'm using 5.2. If I comment out that line, the following line causes the error, so it has to be that the brackets are exposed, no? – Potatrick Nov 9 '13 at 22:33