Using array key names without quotes is an obsolete function in PHP. This was originally done, but it is no longer recommended and is only supported for backward compatibility. It will give a warning message if you have strict mode enabled.
The reason she works is because she sees the key name in this form as a constant. When PHP sees an unknown constant, the constant name is used as the value by default, so it works like a string replacement.
This would break if you had define() elsewhere in your program that set the value of this constant. It also does not work if your keyword name contains spaces, starts with a digit, or is an invalid permanent name for any other reason.
For these reasons, this method is not recommended.
But first of all, PHP developers have publicly stated that this is not a good practice, which may well mean that future versions of PHP exclude the possibility of writing such code.
source share