Neither of these throw an error:

$var = ['foo' => 'bar' ];
$var = [ 'foo' => 'bar'];

Comments

psynaptic created an issue. See original summary.

  • klausi committed 3a13679 on 8.x-2.x
    Issue #2613762: Spaces inside short array brackets don't throw errors
    
klausi’s picture

Version: 8.x-2.4 » 8.x-2.x-dev
Status: Needs work » Fixed

Committed a fix, thanks for reporting!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.