'x' is not array nor implements ArrayAccess

Sample code:

//...
$x = 7;
echo $x[2];                     // 'x' is not array nor implements ArrayAccess
//...

You attempted to access $x as it was array although it wasn't.