see @svec and @jeremy above. All array indices are of type 'int' first, then type 'string', and will be cast to that as PHP sees fit.
Performance wise, $index should be faster than "$index" and "{$index}" (which are the same).
Once you start a double-quote string, PHP will go into interpolation mode and treat it as a string first, but looking for variable markers ($, {}, etc) to replace from the local scope. This is why in most discussions, true 'static' strings should always be single quotes unless you need the escape-shortcuts like "
" or "", because PHP will not need to try to interpolate the string at runtime and the full string can be compiled statically.
In this case, doublequoting will first copy the $index into that string, then return the string, where directly using $index will just return the string.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…