$arr[] = value
)。
This practice is discouraged because if $arr
already contains some value (for example, a string from a request variable), then this value will stay in place and []
may actually stand for string access operator. It is always preferable to initialize a variable by direct assignment.
有关详细信息,请参阅 Creating/modifying with square bracket syntax (php.net)。